mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
Fix breaks to PagedList and Generator Playlists
This commit is contained in:
parent
f4ca81416b
commit
db3925b132
@ -938,10 +938,7 @@ class YoutubeDL(object):
|
||||
'[%s] playlist %s: Downloading %d videos' %
|
||||
(ie_result['extractor'], playlist, num_entries))
|
||||
|
||||
if self.params.get('playlistreverse', False):
|
||||
ie_entries = ie_entries[::-1]
|
||||
|
||||
if isinstance(ie_entries, list):
|
||||
def build_entries_list(ie_entries):
|
||||
n_all_entries = len(ie_entries)
|
||||
if playlistitems:
|
||||
entries = make_playlistitems_entries(ie_entries)
|
||||
@ -951,6 +948,12 @@ class YoutubeDL(object):
|
||||
self.to_screen(
|
||||
'[%s] playlist %s: Collected %d video ids (downloading %d of them)' %
|
||||
(ie_result['extractor'], playlist, n_all_entries, n_entries))
|
||||
return n_entries, entries
|
||||
|
||||
if isinstance(ie_entries, list):
|
||||
if self.params.get('playlistreverse', False):
|
||||
ie_entries = ie_entries[::-1]
|
||||
n_entries, entries = build_entries_list(ie_entries)
|
||||
elif isinstance(ie_entries, PagedList):
|
||||
if playlistitems:
|
||||
entries = []
|
||||
@ -958,12 +961,21 @@ class YoutubeDL(object):
|
||||
entries.extend(ie_entries.getslice(
|
||||
item - 1, item
|
||||
))
|
||||
else:
|
||||
if self.params.get('playlistreverse', False):
|
||||
entries = ie_entries.getslice()
|
||||
entries = entries[::-1][playliststart:playlistend]
|
||||
|
||||
else:
|
||||
entries = ie_entries.getslice(
|
||||
playliststart, playlistend)
|
||||
n_entries = len(entries)
|
||||
report_download(n_entries)
|
||||
else: # iterable
|
||||
if self.params.get('playlistreverse', False):
|
||||
ie_entries = list(ie_entries)[::-1]
|
||||
n_entries, entries = build_entries_list(ie_entries)
|
||||
else:
|
||||
if playlistitems:
|
||||
entries = make_playlistitems_entries(list(itertools.islice(
|
||||
ie_entries, 0, max(playlistitems))))
|
||||
|
Loading…
Reference in New Issue
Block a user