2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
13 class SlidesLiveIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://slideslive\.com/(?P<id>[0-9]+)'
16 # video_service_name = YOUTUBE
17 'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
18 'md5': 'b29fcd6c6952d0c79c5079b0e7a07e6f',
22 'title': 'GCC IA16 backend',
23 'description': 'Watch full version of this video at https://slideslive.com/38902413.',
24 'uploader': 'SlidesLive Videos - A',
25 'uploader_id': 'UC62SdArr41t_-_fX40QCLRw',
26 'timestamp': 1597615266,
27 'upload_date': '20170925',
30 # video_service_name = yoda
31 'url': 'https://slideslive.com/38935785',
32 'md5': '575cd7a6c0acc6e28422fe76dd4bcb1a',
36 'title': 'Offline Reinforcement Learning: From Algorithms to Practical Challenges',
39 'format': 'bestvideo',
42 # video_service_name = youtube
43 'url': 'https://slideslive.com/38903721/magic-a-scientific-resurrection-of-an-esoteric-legend',
44 'only_matching': True,
46 # video_service_name = url
47 'url': 'https://slideslive.com/38922070/learning-transferable-skills-1',
48 'only_matching': True,
50 # video_service_name = vimeo
51 'url': 'https://slideslive.com/38921896/retrospectives-a-venue-for-selfreflection-in-ml-research-3',
52 'only_matching': True,
55 def _real_extract(self
, url
):
56 video_id
= self
._match
_id
(url
)
57 video_data
= self
._download
_json
(
58 'https://ben.slideslive.com/player/' + video_id
, video_id
)
59 service_name
= video_data
['video_service_name'].lower()
60 assert service_name
in ('url', 'yoda', 'vimeo', 'youtube')
61 service_id
= video_data
['video_service_id']
63 for sub
in try_get(video_data
, lambda x
: x
['subtitles'], list) or []:
64 if not isinstance(sub
, dict):
66 webvtt_url
= url_or_none(sub
.get('webvtt_url'))
69 lang
= sub
.get('language') or 'en'
70 subtitles
.setdefault(lang
, []).append({
75 'thumbnail': video_data
.get('thumbnail'),
76 'is_live': bool_or_none(video_data
.get('is_live')),
77 'subtitles': subtitles
,
79 if service_name
in ('url', 'yoda'):
80 info
['title'] = video_data
['title']
81 if service_name
== 'url':
82 info
['url'] = service_id
85 _MANIFEST_PATTERN
= 'https://01.cdn.yoda.slideslive.com/%s/master.%s'
86 # use `m3u8` entry_protocol until EXT-X-MAP is properly supported by `m3u8_native` entry_protocol
87 formats
.extend(self
._extract
_m
3u8_formats
(
88 _MANIFEST_PATTERN
% (service_id
, 'm3u8'),
89 service_id
, 'mp4', m3u8_id
='hls', fatal
=False))
90 formats
.extend(self
._extract
_mpd
_formats
(
91 _MANIFEST_PATTERN
% (service_id
, 'mpd'), service_id
,
92 mpd_id
='dash', fatal
=False))
93 self
._sort
_formats
(formats
)
100 '_type': 'url_transparent',
102 'ie_key': service_name
.capitalize(),
103 'title': video_data
.get('title'),
105 if service_name
== 'vimeo':
106 info
['url'] = smuggle_url(
107 'https://player.vimeo.com/video/' + service_id
,
108 {'http_headers': {'Referer': url}
})