2 from __future__ import unicode_literals
4 from .common import InfoExtractor
7 class StreamangoIE(InfoExtractor):
8 _VALID_URL = r'https?://(?:www\.)?streamango\.com/(?:f|embed)/(?P<id>.+?)/(?:.+)'
10 'url': 'https://streamango.com/f/clapasobsptpkdfe/20170315_150006_mp4',
11 'md5': 'e992787515a182f55e38fc97588d802a',
13 'id': 'clapasobsptpkdfe',
15 'title': '20170315_150006.mp4',
16 'url': r're:https://streamango\.com/v/d/clapasobsptpkdfe~[0-9]{10}~(?:[0-9]+\.){3}[0-9]+~.{8}/720',
19 'url': 'https://streamango.com/embed/clapasobsptpkdfe/20170315_150006_mp4',
20 'only_matching': True,
23 def _real_extract(self, url):
24 def extract_url(urltype):
25 return self._search_regex(
26 r'type\s*:\s*["\']{}["\']\s*,\s*src\s*:\s*["\'](?P<url>.+?)["\'].*'.format(urltype),
27 webpage, 'video URL', group='url')
29 video_id = self._match_id(url)
30 webpage = self._download_webpage(url, video_id)
32 title = self._og_search_title(webpage)
33 url = 'https:' + extract_url('video/mp4')
34 dashurl = extract_url(r'application/dash\+xml')
44 formats.extend(self._extract_mpd_formats(
45 dashurl, video_id, mpd_id='dash', fatal=False))
47 self._sort_formats(formats)