]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/streamango.py
aa4fad162c5ff2e50b6c055af3b0673a3f72f39e
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',
25 'url': 'https://streamango.com/embed/clapasobsptpkdfe/20170315_150006_mp4',
26 'only_matching': True,
29 def _real_extract(self
, url
):
30 video_id
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, video_id
)
34 title
= self
._og
_search
_title
(webpage
)
37 for format_
in re
.findall(r
'({[^}]*\bsrc\s*:\s*[^}]*})', webpage
):
38 video
= self
._parse
_json
(
39 format_
, video_id
, transform_source
=js_to_json
, fatal
=False)
42 src
= video
.get('src')
45 ext
= determine_ext(src
, default_ext
=None)
46 if video
.get('type') == 'application/dash+xml' or ext
== 'mpd':
47 formats
.extend(self
._extract
_mpd
_formats
(
48 src
, video_id
, mpd_id
='dash', fatal
=False))
53 'width': int_or_none(video
.get('width')),
54 'height': int_or_none(video
.get('height')),
55 'tbr': int_or_none(video
.get('bitrate')),
57 self
._sort
_formats
(formats
)