2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
8 from ..compat
import compat_urllib_parse_unquote
11 class BigflixIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?bigflix\.com/.+/(?P<id>[0-9]+)'
15 'url': 'http://www.bigflix.com/Tamil-movies/Drama-movies/Madarasapatinam/16070',
19 'title': 'Madarasapatinam',
20 'description': 'md5:9f0470b26a4ba8e824c823b5d95c2f6b',
21 'formats': 'mincount:2',
24 'skip_download': True,
28 'url': 'http://www.bigflix.com/Malayalam-movies/Drama-movies/Indian-Rupee/15967',
29 'only_matching': True,
32 def _real_extract(self
, url
):
33 video_id
= self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, video_id
)
37 title
= self
._html
_search
_regex
(
38 r
'<div[^>]+class=["\']pagetitle
["\'][^>]*>(.+?)</div>',
41 def decode_url(quoted_b64_url):
42 return base64.b64decode(compat_urllib_parse_unquote(
43 quoted_b64_url).encode('ascii')).decode('utf-8')
46 for height, encoded_url in re.findall(
47 r'ContentURL_(\d{3,4})[pP][^=]+=([^&]+)', webpage):
48 video_url = decode_url(encoded_url)
51 'format_id': '%sp' % height,
52 'height': int(height),
54 if video_url.startswith('rtmp'):
58 file_url = self._search_regex(
59 r'file=([^&]+)', webpage, 'video url', default=None)
61 video_url = decode_url(file_url)
62 if all(f['url'] != video_url for f in formats):
64 'url': decode_url(file_url),
67 self._sort_formats(formats)
69 description = self._html_search_meta('description', webpage)
74 'description': description,