1 from __future__ import unicode_literals
5 from .common import InfoExtractor
11 class TNAFlixIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?tnaflix\.com/(?P<cat_id>[\w-]+)/(?P<display_id>[\w-]+)/video(?P<id>\d+)'
14 'url': 'http://www.tnaflix.com/porn-stars/Carmella-Decesare-striptease/video553878',
15 'md5': 'ecf3498417d09216374fc5907f9c6ec0',
18 'display_id': 'Carmella-Decesare-striptease',
20 'title': 'Carmella Decesare - striptease',
21 'thumbnail': 're:https?://.*\.jpg$',
27 def _real_extract(self, url):
28 mobj = re.match(self._VALID_URL, url)
29 video_id = mobj.group('id')
30 display_id = mobj.group('display_id')
32 webpage = self._download_webpage(url, display_id)
34 redir_url = self._html_search_regex(
35 r'flashvars.config = escape\("([^"]+)"', webpage, 'redirection URL')
36 redirection_webpage = self._download_webpage(redir_url, display_id)
37 sources = self._search_regex(
38 r'<quality>(.+)</quality>', redirection_webpage, 'sources', flags=re.MULTILINE|re.DOTALL)
41 for format_id, video_url in re.findall(r'<res>([^<]+)</res>\s*<videoLink>([^<]+)</videoLink>', sources, flags=re.MULTILINE|re.DOTALL):
44 'format_id': format_id,
46 m = re.search(r'^(\d+)', format_id)
48 fmt['height'] = int(m.group(1))
50 self._sort_formats(formats)
52 title = self._og_search_title(webpage)
54 #duration = self._html_search_regex(r'<meta itemprop="duration" content="T(\d+)M(\d+)S"', webpage, 'duration')
56 thumbnail = self._html_search_regex(
57 r'<meta\s+itemprop="thumbnailUrl"\s+content="([^"]+)"',
58 webpage, 'thumbnail', fatal=False)
62 'display_id': display_id,
65 'thumbnail': thumbnail,
66 #'duration': duration,
67 'age_limit': self._rta_search(webpage),