mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-09 01:24:53 +00:00
Fix bugs in PlaylistEntries
This commit is contained in:
@@ -2950,10 +2950,10 @@ class PlaylistEntries:
|
||||
self.is_exhausted = True
|
||||
|
||||
requested_entries = info_dict.get('requested_entries')
|
||||
self.is_incomplete = bool(requested_entries)
|
||||
self.is_incomplete = requested_entries is not None
|
||||
if self.is_incomplete:
|
||||
assert self.is_exhausted
|
||||
self._entries = [self.MissingEntry] * max(requested_entries)
|
||||
self._entries = [self.MissingEntry] * max(requested_entries or [0])
|
||||
for i, entry in zip(requested_entries, entries):
|
||||
self._entries[i - 1] = entry
|
||||
elif isinstance(entries, (list, PagedList, LazyList)):
|
||||
@@ -3022,7 +3022,7 @@ class PlaylistEntries:
|
||||
if not self.is_incomplete:
|
||||
raise self.IndexError()
|
||||
if entry is self.MissingEntry:
|
||||
raise EntryNotInPlaylist(f'Entry {i} cannot be found')
|
||||
raise EntryNotInPlaylist(f'Entry {i + 1} cannot be found')
|
||||
return entry
|
||||
else:
|
||||
def get_entry(i):
|
||||
|
Reference in New Issue
Block a user