1 from .common
import InfoExtractor
10 class SlidesLiveIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://slideslive\.com/(?P<id>[0-9]+)'
13 # video_service_name = YOUTUBE
14 'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
15 'md5': 'b29fcd6c6952d0c79c5079b0e7a07e6f',
19 'title': 'GCC IA16 backend',
20 'description': 'Watch full version of this video at https://slideslive.com/38902413.',
21 'uploader': 'SlidesLive Videos - A',
22 'uploader_id': 'UC62SdArr41t_-_fX40QCLRw',
23 'timestamp': 1597615266,
24 'upload_date': '20170925',
27 # video_service_name = yoda
28 'url': 'https://slideslive.com/38935785',
29 'md5': '575cd7a6c0acc6e28422fe76dd4bcb1a',
33 'title': 'Offline Reinforcement Learning: From Algorithms to Practical Challenges',
36 # video_service_name = youtube
37 'url': 'https://slideslive.com/38903721/magic-a-scientific-resurrection-of-an-esoteric-legend',
38 'only_matching': True,
40 # video_service_name = url
41 'url': 'https://slideslive.com/38922070/learning-transferable-skills-1',
42 'only_matching': True,
44 # video_service_name = vimeo
45 'url': 'https://slideslive.com/38921896/retrospectives-a-venue-for-selfreflection-in-ml-research-3',
46 'only_matching': True,
49 def _real_extract(self
, url
):
50 video_id
= self
._match
_id
(url
)
51 video_data
= self
._download
_json
(
52 'https://ben.slideslive.com/player/' + video_id
, video_id
)
53 service_name
= video_data
['video_service_name'].lower()
54 assert service_name
in ('url', 'yoda', 'vimeo', 'youtube')
55 service_id
= video_data
['video_service_id']
57 for sub
in try_get(video_data
, lambda x
: x
['subtitles'], list) or []:
58 if not isinstance(sub
, dict):
60 webvtt_url
= url_or_none(sub
.get('webvtt_url'))
63 lang
= sub
.get('language') or 'en'
64 subtitles
.setdefault(lang
, []).append({
69 'thumbnail': video_data
.get('thumbnail'),
70 'is_live': bool_or_none(video_data
.get('is_live')),
71 'subtitles': subtitles
,
73 if service_name
in ('url', 'yoda'):
74 info
['title'] = video_data
['title']
75 if service_name
== 'url':
76 info
['url'] = service_id
79 _MANIFEST_PATTERN
= 'https://01.cdn.yoda.slideslive.com/%s/master.%s'
80 # use `m3u8` entry_protocol until EXT-X-MAP is properly supported by `m3u8_native` entry_protocol
81 formats
.extend(self
._extract
_m
3u8_formats
(
82 _MANIFEST_PATTERN
% (service_id
, 'm3u8'),
83 service_id
, 'mp4', m3u8_id
='hls', fatal
=False))
84 formats
.extend(self
._extract
_mpd
_formats
(
85 _MANIFEST_PATTERN
% (service_id
, 'mpd'), service_id
,
86 mpd_id
='dash', fatal
=False))
87 self
._sort
_formats
(formats
)
94 '_type': 'url_transparent',
96 'ie_key': service_name
.capitalize(),
97 'title': video_data
.get('title'),
99 if service_name
== 'vimeo':
100 info
['url'] = smuggle_url(
101 'https://player.vimeo.com/video/' + service_id
,
102 {'http_headers': {'Referer': url}
})