From: Sergey M․ Date: Sun, 18 May 2014 07:23:02 +0000 (+0700) Subject: [ndr] Improve thumbnail extraction X-Git-Tag: 2014.05.19~1 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=4ea5c7b70dd5cb26036cea815a9d9599aac0de36;p=youtube-dl.git [ndr] Improve thumbnail extraction --- diff --git a/youtube_dl/extractor/ndr.py b/youtube_dl/extractor/ndr.py index ae1fe866eb..53b34f5e64 100644 --- a/youtube_dl/extractor/ndr.py +++ b/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']: