mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-07 07:15:00 +01:00
Merge de3cb27188 into 7ec6b9bc40
This commit is contained in:
commit
a98ff6c2ec
1 changed files with 3 additions and 1 deletions
|
|
@ -2437,9 +2437,11 @@ class PlaylistEntries:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parse_playlist_items(cls, string):
|
def parse_playlist_items(cls, string):
|
||||||
|
if string.startswith(',') or string.endswith(','):
|
||||||
|
raise ValueError('There is an invalid leading comma or a trailing comma')
|
||||||
for segment in string.split(','):
|
for segment in string.split(','):
|
||||||
if not segment:
|
if not segment:
|
||||||
raise ValueError('There is two or more consecutive commas')
|
raise ValueError('There are two or more consecutive commas')
|
||||||
mobj = cls.PLAYLIST_ITEMS_RE.fullmatch(segment)
|
mobj = cls.PLAYLIST_ITEMS_RE.fullmatch(segment)
|
||||||
if not mobj:
|
if not mobj:
|
||||||
raise ValueError(f'{segment!r} is not a valid specification')
|
raise ValueError(f'{segment!r} is not a valid specification')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue