浏览代码

YoutubeDL: ignore indexes from 'playlist_items' that are not in the list (fixes #5706)

We ignore them instead of failing to match the behaviour of the 'playliststart' parameter.
Jaime Marquínez Ferrándiz 10 年之前
父节点
当前提交
3884dcf313
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      youtube_dl/YoutubeDL.py

+ 3 - 1
youtube_dl/YoutubeDL.py

@@ -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)