mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 10:07:43 -05:00
Allow 0
in --playlist-items
This commit is contained in:
parent
600e900300
commit
ff1c7fc9d3
@ -1000,6 +1000,7 @@ class TestYoutubeDL(unittest.TestCase):
|
|||||||
test_selection({'playlist_items': '2-4'}, [2, 3, 4])
|
test_selection({'playlist_items': '2-4'}, [2, 3, 4])
|
||||||
test_selection({'playlist_items': '2,4'}, [2, 4])
|
test_selection({'playlist_items': '2,4'}, [2, 4])
|
||||||
test_selection({'playlist_items': '10'}, [])
|
test_selection({'playlist_items': '10'}, [])
|
||||||
|
test_selection({'playlist_items': '0'}, [])
|
||||||
|
|
||||||
# Tests for https://github.com/ytdl-org/youtube-dl/issues/10591
|
# Tests for https://github.com/ytdl-org/youtube-dl/issues/10591
|
||||||
test_selection({'playlist_items': '2-4,3-4,3'}, [2, 3, 4])
|
test_selection({'playlist_items': '2-4,3-4,3'}, [2, 3, 4])
|
||||||
|
@ -1464,7 +1464,10 @@ class YoutubeDL(object):
|
|||||||
)(self, i)
|
)(self, i)
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
for i in playlistitems or itertools.count(playliststart):
|
items = playlistitems if playlistitems is not None else itertools.count(playliststart)
|
||||||
|
for i in items:
|
||||||
|
if i == 0:
|
||||||
|
continue
|
||||||
if playlistitems is None and playlistend is not None and playlistend < i:
|
if playlistitems is None and playlistend is not None and playlistend < i:
|
||||||
break
|
break
|
||||||
entry = None
|
entry = None
|
||||||
|
Loading…
Reference in New Issue
Block a user