1 from __future__ import unicode_literals
5 from .common import InfoExtractor
12 class SunPornoIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?sunporno\.com/videos/(?P<id>\d+)'
15 'url': 'http://www.sunporno.com/videos/807778/',
16 'md5': '6457d3c165fd6de062b99ef6c2ff4c86',
20 'title': 'md5:0a400058e8105d39e35c35e7c5184164',
21 'description': 'md5:a31241990e1bd3a64e72ae99afb325fb',
26 def _real_extract(self, url):
27 mobj = re.match(self._VALID_URL, url)
28 video_id = mobj.group('id')
30 webpage = self._download_webpage(url, video_id)
32 video_url = self._html_search_regex(
33 r'videoSource\s*=\s*\'<source\s*src="([^"]*)"', webpage, 'video URL')
35 title = self._html_search_regex(r'<title>([^<]*)</title>', webpage, 'title')
37 description = self._html_search_regex(
38 r'<meta name="description" content="([^"]*)"', webpage, 'description', fatal=False)
40 thumbnail = self._html_search_regex(
41 r'poster="([^"]*)"', webpage, 'thumbnail', fatal=False)
43 duration = parse_duration(self._search_regex(
44 r'<span>Duration: (\d+:\d+)</span>', webpage, 'duration', fatal=False))
46 view_count = int_or_none(self._html_search_regex(
47 r'<span class="views">(\d+)</span>', webpage, 'view count', fatal=False))
53 'description': description,
54 'thumbnail': thumbnail,
56 'view_count': view_count,