瀏覽代碼

[ndr] Improve thumbnail extraction

Sergey M․ 11 年之前
父節點
當前提交
4ea5c7b70d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/extractor/ndr.py

+ 1 - 1
youtube_dl/extractor/ndr.py

@@ -71,7 +71,7 @@ class NDRIE(InfoExtractor):
             thumbnails = re.findall(r'''\d+: {src: "([^"]+)"(?: \|\| '[^']+')?, quality: '([^']+)'}''', page)
             if thumbnails:
                 QUALITIES = ['xs', 's', 'm', 'l', 'xl']
-                thumbnails.sort(key=lambda thumb: QUALITIES.index(thumb[1]))
+                thumbnails.sort(key=lambda thumb: QUALITIES.index(thumb[1]) if thumb[1] in QUALITIES else -1)
                 thumbnail = 'http://www.ndr.de' + thumbnails[-1][0]
 
             for format_id in ['lo', 'hi', 'hq']: