]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cloudflarestream.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
9 class CloudflareStreamIE(InfoExtractor
):
13 (?:watch\.)?cloudflarestream\.com/|
14 embed\.cloudflarestream\.com/embed/[^/]+\.js\?.*?\bvideo=
19 'url': 'https://embed.cloudflarestream.com/embed/we4g.fla9.latest.js?video=31c9291ab41fac05471db4e73aa11717',
21 'id': '31c9291ab41fac05471db4e73aa11717',
23 'title': '31c9291ab41fac05471db4e73aa11717',
26 'skip_download': True,
29 'url': 'https://watch.cloudflarestream.com/9df17203414fd1db3e3ed74abbe936c1',
30 'only_matching': True,
32 'url': 'https://cloudflarestream.com/31c9291ab41fac05471db4e73aa11717/manifest/video.mpd',
33 'only_matching': True,
37 def _extract_urls(webpage
):
40 for mobj
in re
.finditer(
41 r
'<script[^>]+\bsrc=(["\'])(?P
<url
>(?
:https?
:)?
//embed\
.cloudflarestream\
.com
/embed
/[^
/]+\
.js
\?.*?
\bvideo
=[\da
-f
]+?
.*?
)\
1',
44 def _real_extract(self, url):
45 video_id = self._match_id(url)
47 formats = self._extract_m3u8_formats(
48 'https
://cloudflarestream
.com
/%s/manifest
/video
.m3u8
' % video_id,
49 video_id, 'mp4
', entry_protocol='m3u8_native
', m3u8_id='hls
',
51 formats.extend(self._extract_mpd_formats(
52 'https
://cloudflarestream
.com
/%s/manifest
/video
.mpd
' % video_id,
53 video_id, mpd_id='dash
', fatal=False))
54 self._sort_formats(formats)