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.ehow.com/video_12245069_hardwood-flooring-basics.html',
10 u'file': u'12245069.flv',
11 u'md5': u'9809b4e3f115ae2088440bcb4efbf371',
13 u"title": u"Hardwood Flooring Basics",
14 u"description": u"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...",
15 u"uploader": u"Erick Nathan"
19 def _real_extract(self, url):
20 mobj = re.match(self._VALID_URL, url)
21 video_id = mobj.group(1).split("_")[1]
22 webpage = self._download_webpage(url, video_id)
23 video_url = self._search_regex(r'[^A-Za-z0-9]?(?:file|source)=(http[^\'"&]*)',
24 webpage, u'video URL')
25 final_url = compat_urllib_parse.unquote(video_url)
26 thumbnail_url = self._search_regex(r'<meta property="og:image" content="(.+?)" />',
27 webpage, u'thumbnail URL')
28 uploader = self._search_regex(r'<meta name="uploader" content="(.+?)" />',
30 title = self._search_regex(r'<meta property="og:title" content="(.+?)" />',
31 webpage, u'Video title').replace(' | eHow','')
32 description = self._search_regex(r'<meta property="og:description" content="(.+?)" />',
33 webpage, u'video description')
34 ext = final_url.split('.')[-1]
40 'thumbnail': thumbnail_url,
41 'description': description,