]>
Commit | Line | Data |
---|---|---|
f35b84c8 | 1 | from .common import InfoExtractor |
c60e8cfa | 2 | from ..compat import compat_urllib_parse_unquote |
f35b84c8 YK |
3 | |
4 | ||
81082e04 | 5 | class EHowIE(InfoExtractor): |
d26ebe99 JMF |
6 | IE_NAME = 'eHow' |
7 | _VALID_URL = r'https?://(?:www\.)?ehow\.com/[^/_?]*_(?P<id>[0-9]+)' | |
f35b84c8 | 8 | _TEST = { |
d26ebe99 JMF |
9 | 'url': 'http://www.ehow.com/video_12245069_hardwood-flooring-basics.html', |
10 | 'md5': '9809b4e3f115ae2088440bcb4efbf371', | |
11 | 'info_dict': { | |
12 | 'id': '12245069', | |
13 | 'ext': 'flv', | |
14 | 'title': 'Hardwood Flooring Basics', | |
15 | '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...', | |
16 | 'uploader': 'Erick Nathan', | |
f35b84c8 YK |
17 | } |
18 | } | |
19 | ||
20 | def _real_extract(self, url): | |
1cc79574 | 21 | video_id = self._match_id(url) |
f35b84c8 | 22 | webpage = self._download_webpage(url, video_id) |
1cc79574 PH |
23 | video_url = self._search_regex( |
24 | r'(?:file|source)=(http[^\'"&]*)', webpage, 'video URL') | |
d3671b34 | 25 | final_url = compat_urllib_parse_unquote(video_url) |
d26ebe99 | 26 | uploader = self._html_search_meta('uploader', webpage) |
46720279 | 27 | title = self._og_search_title(webpage).replace(' | eHow', '') |
81082e04 PH |
28 | |
29 | return { | |
d26ebe99 JMF |
30 | 'id': video_id, |
31 | 'url': final_url, | |
32 | 'title': title, | |
33 | 'thumbnail': self._og_search_thumbnail(webpage), | |
46720279 | 34 | 'description': self._og_search_description(webpage), |
d26ebe99 | 35 | 'uploader': uploader, |
81082e04 | 36 | } |