diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-07-08 01:15:19 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-07-08 01:15:19 +0200 |
commit | d93e4dcbb7fb68666528e251623b90d832d9cffc (patch) | |
tree | 91a26ec50b8fbf16709b1ba97fbdc597335b9e44 /youtube_dl/extractor/youtube.py | |
parent | 73e79f2a1be3179edd8eebf4b7b6d56fe953a4a8 (diff) | |
parent | fc79158de2779a9f2d3fb16ddfb2878b82693b79 (diff) |
Merge branch 'master' of github.com:rg3/youtube-dl
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 7a2a8a4f8..e2296d153 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -473,7 +473,12 @@ class YoutubeIE(InfoExtractor): video_title = compat_urllib_parse.unquote_plus(video_info['title'][0]) # thumbnail image - if 'thumbnail_url' not in video_info: + # We try first to get a high quality image: + m_thumb = re.search(r'<span itemprop="thumbnail".*?href="(.*?)">', + video_webpage, re.DOTALL) + if m_thumb is not None: + video_thumbnail = m_thumb.group(1) + elif 'thumbnail_url' not in video_info: self._downloader.report_warning(u'unable to extract video thumbnail') video_thumbnail = '' else: # don't panic if we can't find it |