2 from ..utils import compat_urllib_parse
3 from .common import InfoExtractor
6 class EhowIE(InfoExtractor):
7 _VALID_URL = r'(?:http://)?(?:www\.)?ehow\.com/([^/]+)'
9 u'url': u'http://www.break.com/video/when-girls-act-like-guys-2468056',
10 u'file': u'2468056.mp4',
11 u'md5': u'a3513fb1547fba4fb6cfac1bffc6c46b',
13 u"title": u"When Girls Act Like D-Bags"
17 def _real_extract(self, url):
18 mobj = re.match(self._VALID_URL, url)
19 video_id = mobj.group(1).split("_")[1]
20 webpage = self._download_webpage(url, video_id)
21 video_url = self._search_regex(r'[^A-Za-z0-9]?(?:file|source)=(http[^\'"&]*)',
22 webpage, u'video URL')
23 final_url = compat_urllib_parse.unquote(video_url)
24 thumbnail_url = self._search_regex(r'<meta property="og:image" content="(.+?)" />',
25 webpage, u'thumbnail URL')
26 uploader = self._search_regex(r'<meta name="uploader" content="(.+?)" />',
28 title = self._search_regex(r'<meta property="og:title" content="(.+?)" />',
29 webpage, u'Video title').replace(' | eHow','')
30 description = self._search_regex(r'<meta property="og:description" content="(.+?)" />',
31 webpage, u'video description')
32 ext = final_url.split('.')[-1]
38 'thumbnail': thumbnail_url,
39 'description': description,