]>
Commit | Line | Data |
---|---|---|
d26ebe99 JMF |
1 | from __future__ import unicode_literals |
2 | ||
f35b84c8 | 3 | import re |
81082e04 PH |
4 | |
5 | from ..utils import ( | |
6 | compat_urllib_parse, | |
81082e04 | 7 | ) |
f35b84c8 YK |
8 | from .common import InfoExtractor |
9 | ||
10 | ||
81082e04 | 11 | class EHowIE(InfoExtractor): |
d26ebe99 JMF |
12 | IE_NAME = 'eHow' |
13 | _VALID_URL = r'https?://(?:www\.)?ehow\.com/[^/_?]*_(?P<id>[0-9]+)' | |
f35b84c8 | 14 | _TEST = { |
d26ebe99 JMF |
15 | 'url': 'http://www.ehow.com/video_12245069_hardwood-flooring-basics.html', |
16 | 'md5': '9809b4e3f115ae2088440bcb4efbf371', | |
17 | 'info_dict': { | |
18 | 'id': '12245069', | |
19 | 'ext': 'flv', | |
20 | 'title': 'Hardwood Flooring Basics', | |
21 | 'description': 'Hardwood flooring may be time consuming, but its ultimately a pretty straightforward concept. Learn about hardwood flooring basics with help from a hardware flooring business owner in this free video...', | |
22 | 'uploader': 'Erick Nathan', | |
f35b84c8 YK |
23 | } |
24 | } | |
25 | ||
26 | def _real_extract(self, url): | |
27 | mobj = re.match(self._VALID_URL, url) | |
81082e04 | 28 | video_id = mobj.group('id') |
f35b84c8 | 29 | webpage = self._download_webpage(url, video_id) |
81082e04 | 30 | video_url = self._search_regex(r'(?:file|source)=(http[^\'"&]*)', |
d26ebe99 JMF |
31 | webpage, 'video URL') |
32 | final_url = compat_urllib_parse.unquote(video_url) | |
33 | uploader = self._html_search_meta('uploader', webpage) | |
46720279 | 34 | title = self._og_search_title(webpage).replace(' | eHow', '') |
81082e04 PH |
35 | |
36 | return { | |
d26ebe99 JMF |
37 | 'id': video_id, |
38 | 'url': final_url, | |
39 | 'title': title, | |
40 | 'thumbnail': self._og_search_thumbnail(webpage), | |
46720279 | 41 | 'description': self._og_search_description(webpage), |
d26ebe99 | 42 | 'uploader': uploader, |
81082e04 | 43 | } |