aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M. <dstftw@gmail.com>2014-06-05 19:31:28 +0700
committerSergey M. <dstftw@gmail.com>2014-06-05 19:31:28 +0700
commitb3ae826f7a94420200afe6955d5693416ae84d8e (patch)
tree04d2f43e1a5183472141e662cd14a7431e80e586 /youtube_dl
parentfb6a5b965b9c2ba1c263036d6b353d5ff0a80b05 (diff)
parentdede691aca17d7a46720e0ae5084e3284758268a (diff)
downloadyoutube-dl-b3ae826f7a94420200afe6955d5693416ae84d8e.tar.xz
Merge pull request #3047 from pulpe/yahoo_thumb
[yahoo] improve thumbnail extraction
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/yahoo.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/extractor/yahoo.py b/youtube_dl/extractor/yahoo.py
index 181522494..d84be2562 100644
--- a/youtube_dl/extractor/yahoo.py
+++ b/youtube_dl/extractor/yahoo.py
@@ -70,9 +70,9 @@ class YahooIE(InfoExtractor):
# The 'meta' field is not always in the video webpage, we request it
# from another page
long_id = info['id']
- return self._get_info(long_id, video_id)
+ return self._get_info(long_id, video_id, webpage)
- def _get_info(self, long_id, video_id):
+ def _get_info(self, long_id, video_id, webpage):
query = ('SELECT * FROM yahoo.media.video.streams WHERE id="%s"'
' AND plrs="86Gj0vCaSzV_Iuf6hNylf2" AND region="US"'
' AND protocol="http"' % long_id)
@@ -115,7 +115,7 @@ class YahooIE(InfoExtractor):
'title': meta['title'],
'formats': formats,
'description': clean_html(meta['description']),
- 'thumbnail': meta.get('thumbnail'),
+ 'thumbnail': meta['thumbnail'] if meta.get('thumbnail') else self._og_search_thumbnail(webpage),
}
@@ -139,7 +139,7 @@ class YahooNewsIE(YahooIE):
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
long_id = self._search_regex(r'contentId: \'(.+?)\',', webpage, 'long id')
- return self._get_info(long_id, video_id)
+ return self._get_info(long_id, video_id, webpage)
class YahooSearchIE(SearchInfoExtractor):