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