4 from .common import InfoExtractor
6 compat_urllib_parse_urlparse,
11 class MofosexIE(InfoExtractor):
12 _VALID_URL = r'^(?:https?://)?(?:www\.)?(?P<url>mofosex\.com/videos/(?P<videoid>[0-9]+)/.*?\.html)'
14 u'url': u'http://www.mofosex.com/videos/5018/japanese-teen-music-video.html',
16 u'md5': u'1b2eb47ac33cc75d4a80e3026b613c5a',
18 u"title": u"Japanese Teen Music Video",
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
25 video_id = mobj.group('videoid')
26 url = 'http://www.' + mobj.group('url')
28 req = compat_urllib_request.Request(url)
29 req.add_header('Cookie', 'age_verified=1')
30 webpage = self._download_webpage(req, video_id)
32 video_title = self._html_search_regex(r'<h1>(.+?)<', webpage, u'title')
33 video_url = compat_urllib_parse.unquote(self._html_search_regex(r'flashvars.video_url = \'([^\']+)', webpage, u'video_url'))
34 path = compat_urllib_parse_urlparse(video_url).path
35 extension = os.path.splitext(path)[1][1:]
36 format = path.split('/')[5].split('_')[:2]
37 format = "-".join(format)
39 age_limit = self._rta_search(webpage)
48 'age_limit': age_limit,