1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-25 09:54:32 +01:00

[cloudflarestream] fix JSON parsing of video_id

This commit is contained in:
Maxim Rubis 2020-04-13 23:20:26 -04:00
parent 00eb865b3c
commit 89183498ef

View File

@ -29,6 +29,17 @@ class CloudflareStreamIE(InfoExtractor):
'params': {
'skip_download': True,
},
}, {
'url': 'https://embed.videodelivery.net/embed/r4xu.fla9.latest.js?video=eyJhbGciOiJSUzI1NiIsImtpZCI6IjEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyIn0.eyJzdWIiOiI1ZDViYzM3ZmZjZjU0YzliODJlOTk2ODIzYmZmYmI4MSIsImtpZCI6IjVkNWJjMzdmZmNmNTRjOWI4MmU5OTY4MjNiZmZiYjgxIiwiZXhwIjoiMTYxNzM0NjgwMCIsIm5iZiI6IjE1ODU4MTA4MDAifQ.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'info_dict': {
'id': '5d5bc37ffcf54c9b82e996823bffbb81',
'ext': 'mp4',
'title': '5d5bc37ffcf54c9b82e996823bffbb81',
},
'params': {
'format': 'bestvideo',
'skip_download': True,
},
}, {
'url': 'https://watch.cloudflarestream.com/9df17203414fd1db3e3ed74abbe936c1',
'only_matching': True,
@ -53,8 +64,9 @@ class CloudflareStreamIE(InfoExtractor):
domain = 'bytehighway.net' if 'bytehighway.net/' in url else 'videodelivery.net'
base_url = 'https://%s/%s/' % (domain, video_id)
if '.' in video_id:
video_id = self._parse_json(base64.urlsafe_b64decode(
video_id.split('.')[1]), video_id)['sub']
video_id = video_id.split('.')[1] + '===='
video_id = self._parse_json(base64.b64decode(
video_id), video_id)['sub']
manifest_base_url = base_url + 'manifest/video.'
formats = self._extract_m3u8_formats(