mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
HowcastIE: extract thumbnail
This commit is contained in:
parent
17bd1b2f41
commit
b1d568f0bc
1 changed files with 8 additions and 0 deletions
|
@ -4079,6 +4079,8 @@ def _real_extract(self, url):
|
||||||
webpage_url = 'http://www.howcast.com/videos/' + video_id
|
webpage_url = 'http://www.howcast.com/videos/' + video_id
|
||||||
webpage = self._download_webpage(webpage_url, video_id)
|
webpage = self._download_webpage(webpage_url, video_id)
|
||||||
|
|
||||||
|
self.report_extraction(video_id)
|
||||||
|
|
||||||
mobj = re.search(r'\'file\': "(http://mobile-media\.howcast\.com/\d+\.mp4)"', webpage)
|
mobj = re.search(r'\'file\': "(http://mobile-media\.howcast\.com/\d+\.mp4)"', webpage)
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
raise ExtractorError(u'Unable to extract video URL')
|
raise ExtractorError(u'Unable to extract video URL')
|
||||||
|
@ -4096,12 +4098,18 @@ def _real_extract(self, url):
|
||||||
else:
|
else:
|
||||||
video_description = mobj.group(1) or mobj.group(2)
|
video_description = mobj.group(1) or mobj.group(2)
|
||||||
|
|
||||||
|
mobj = re.search(r'<meta content=\'(.+?)\' property=\'og:image\'', webpage)
|
||||||
|
if mobj is None:
|
||||||
|
raise ExtractorError(u'Unable to extract thumbnail')
|
||||||
|
thumbnail = mobj.group(1)
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'description': video_description,
|
'description': video_description,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
class VineIE(InfoExtractor):
|
class VineIE(InfoExtractor):
|
||||||
|
|
Loading…
Reference in a new issue