2 from __future__ import unicode_literals
6 from .common import InfoExtractor
14 class StreamangoIE(InfoExtractor):
15 _VALID_URL = r'https?://(?:www\.)?streamango\.com/(?:f|embed)/(?P<id>[^/?#&]+)'
17 'url': 'https://streamango.com/f/clapasobsptpkdfe/20170315_150006_mp4',
18 'md5': 'e992787515a182f55e38fc97588d802a',
20 'id': 'clapasobsptpkdfe',
22 'title': '20170315_150006.mp4',
26 'url': 'https://streamango.com/embed/foqebrpftarclpob/asdf_asd_2_mp4',
28 'id': 'foqebrpftarclpob',
30 'title': 'foqebrpftarclpob',
33 'skip_download': True,
36 'url': 'https://streamango.com/embed/clapasobsptpkdfe/20170315_150006_mp4',
37 'only_matching': True,
40 def _real_extract(self, url):
41 video_id = self._match_id(url)
43 webpage = self._download_webpage(url, video_id)
45 title = self._og_search_title(webpage, default=video_id)
48 for format_ in re.findall(r'({[^}]*\bsrc\s*:\s*[^}]*})', webpage):
49 video = self._parse_json(
50 format_, video_id, transform_source=js_to_json, fatal=False)
53 src = video.get('src')
56 ext = determine_ext(src, default_ext=None)
57 if video.get('type') == 'application/dash+xml' or ext == 'mpd':
58 formats.extend(self._extract_mpd_formats(
59 src, video_id, mpd_id='dash', fatal=False))
64 'width': int_or_none(video.get('width')),
65 'height': int_or_none(video.get('height')),
66 'tbr': int_or_none(video.get('bitrate')),
68 self._sort_formats(formats)