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]+)'
14 'url': 'http://www.bigflix.com/Hindi-movies/Action-movies/Singham-Returns/16537',
15 'md5': 'ec76aa9b1129e2e5b301a474e54fab74',
19 'title': 'Singham Returns',
20 'description': 'md5:3d2ba5815f14911d5cc6a501ae0cf65d',
24 'url': 'http://www.bigflix.com/Tamil-movies/Drama-movies/Madarasapatinam/16070',
28 'title': 'Madarasapatinam',
29 'description': 'md5:63b9b8ed79189c6f0418c26d9a3452ca',
30 'formats': 'mincount:2',
33 'skip_download': True,
37 def _real_extract(self, url):
38 video_id = self._match_id(url)
40 webpage = self._download_webpage(url, video_id)
42 title = self._html_search_regex(
43 r'<div[^>]+class=["\']pagetitle["\'][^>]*>(.+?)</div>',
46 def decode_url(quoted_b64_url):
47 return base64.b64decode(compat_urllib_parse_unquote(
48 quoted_b64_url)).encode('ascii').decode('utf-8')
51 'url': decode_url(encoded_url),
52 'format_id': '%sp' % height,
53 'height': int(height),
54 } for height, encoded_url in re.findall(
55 r'ContentURL_(\d{3,4})[pP][^=]+=([^&]+)', webpage)]
59 'url': decode_url(self._search_regex(
60 r'file=([^&]+)', webpage, 'video url')),
63 description = self._html_search_meta('description', webpage)
68 'description': description,