Fix playlist_index not obeying playlist_start

and add tests
Closes #720
This commit is contained in:
pukkandan
2021-08-17 19:02:06 +05:30
parent 8f18aca871
commit 9e598870dd
2 changed files with 23 additions and 46 deletions

View File

@@ -1452,7 +1452,7 @@ class YoutubeDL(object):
# Save playlist_index before re-ordering
entries = [
((playlistitems[i - 1] if playlistitems else i), entry)
((playlistitems[i - 1] if playlistitems else i + playliststart - 1), entry)
for i, entry in enumerate(entries, 1)
if entry is not None]
n_entries = len(entries)
@@ -1517,7 +1517,7 @@ class YoutubeDL(object):
max_failures = self.params.get('skip_playlist_after_errors') or float('inf')
for i, entry_tuple in enumerate(entries, 1):
playlist_index, entry = entry_tuple
if 'playlist_index' in self.params.get('compat_options', []):
if 'playlist-index' in self.params.get('compat_options', []):
playlist_index = playlistitems[i - 1] if playlistitems else i
self.to_screen('[download] Downloading video %s of %s' % (i, n_entries))
# This __x_forwarded_for_ip thing is a bit ugly but requires