YoutubeDL: ignore indexes from 'playlist_items' that are not in the list (fixes ...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 15 May 2015 12:03:00 +0000 (14:03 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 15 May 2015 12:08:26 +0000 (14:08 +0200)
We ignore them instead of failing to match the behaviour of the 'playliststart' parameter.

youtube_dl/YoutubeDL.py

index 691f3e09f807de52c1c19f334befd0ccc0d4f82c..5df889945947eda4ae1b8a152a1e325c9cb56936 100755 (executable)
@@ -759,7 +759,9 @@ class YoutubeDL(object):
             if isinstance(ie_entries, list):
                 n_all_entries = len(ie_entries)
                 if playlistitems:
-                    entries = [ie_entries[i - 1] for i in playlistitems]
+                    entries = [
+                        ie_entries[i - 1] for i in playlistitems
+                        if -n_all_entries <= i - 1 < n_all_entries]
                 else:
                     entries = ie_entries[playliststart:playlistend]
                 n_entries = len(entries)