[ndr] Improve thumbnail extraction
authorSergey M․ <dstftw@gmail.com>
Sun, 18 May 2014 07:23:02 +0000 (14:23 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 18 May 2014 07:23:02 +0000 (14:23 +0700)
youtube_dl/extractor/ndr.py

index ae1fe866eb8e91354994523d5440c443231df0f1..53b34f5e646b233dd72a0657be5d285e1a534ddc 100644 (file)
@@ -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']: