]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/howcast.py
7b94f85adc2730cdf13304bcbb47b84de6ecc244
3 from .common
import InfoExtractor
6 class HowcastIE(InfoExtractor
):
7 _VALID_URL
= r
'(?:https?://)?(?:www\.)?howcast\.com/videos/(?P<id>\d+)'
9 def _real_extract(self
, url
):
10 mobj
= re
.match(self
._VALID
_URL
, url
)
12 video_id
= mobj
.group('id')
13 webpage_url
= 'http://www.howcast.com/videos/' + video_id
14 webpage
= self
._download
_webpage
(webpage_url
, video_id
)
16 self
.report_extraction(video_id
)
18 video_url
= self
._search
_regex
(r
'\'?
file\'?
: "(http://mobile-media\.howcast\.com/[0-9]+\.mp4)',
19 webpage, u'video URL')
21 video_title = self._html_search_regex(r'<meta content=(?:"([^
"]+)"|
\'([^
\']+)\') property=\'og
:title
\'',
24 video_description = self._html_search_regex(r'<meta content
=(?
:"([^"]+)"|\'([^\']+)\') name=\'description\'',
25 webpage, u'description', fatal=False)
27 thumbnail = self._html_search_regex(r'<meta content=\'(.+?)\' property=\'og:image\'',
28 webpage, u'thumbnail', fatal=False)
35 'description': video_description,
36 'thumbnail': thumbnail,