aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/slideslive.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2019-12-14 21:35:31 +0100
committerRemita Amine <remitamine@gmail.com>2019-12-14 21:35:31 +0100
commit73d8f3a63426e8517143e3a5554e12d614c5cdec (patch)
tree852a5b37d70e0d734615e8c8dadc02ccc160a349 /youtube_dl/extractor/slideslive.py
parentb33a05d2213020fd4a74a1790db728a367f82517 (diff)
[slideslive] add support for url and vimeo service names(closes #23414)
Diffstat (limited to 'youtube_dl/extractor/slideslive.py')
-rw-r--r--youtube_dl/extractor/slideslive.py39
1 files changed, 27 insertions, 12 deletions
diff --git a/youtube_dl/extractor/slideslive.py b/youtube_dl/extractor/slideslive.py
index 467af2cb3..d9ea76831 100644
--- a/youtube_dl/extractor/slideslive.py
+++ b/youtube_dl/extractor/slideslive.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
from .common import InfoExtractor
-from ..utils import ExtractorError
+from ..utils import smuggle_url
class SlidesLiveIE(InfoExtractor):
@@ -24,6 +24,14 @@ class SlidesLiveIE(InfoExtractor):
# video_service_name = youtube
'url': 'https://slideslive.com/38903721/magic-a-scientific-resurrection-of-an-esoteric-legend',
'only_matching': True,
+ }, {
+ # video_service_name = url
+ 'url': 'https://slideslive.com/38922070/learning-transferable-skills-1',
+ 'only_matching': True,
+ }, {
+ # video_service_name = vimeo
+ 'url': 'https://slideslive.com/38921896/retrospectives-a-venue-for-selfreflection-in-ml-research-3',
+ 'only_matching': True,
}]
def _real_extract(self, url):
@@ -31,16 +39,23 @@ class SlidesLiveIE(InfoExtractor):
video_data = self._download_json(
'https://ben.slideslive.com/player/' + video_id, video_id)
service_name = video_data['video_service_name'].lower()
- if service_name == 'youtube':
- yt_video_id = video_data['video_service_id']
- return {
+ assert service_name in ('url', 'vimeo', 'youtube')
+ service_id = video_data['video_service_id']
+ info = {
+ 'id': video_id,
+ 'thumbnail': video_data.get('thumbnail'),
+ 'url': service_id,
+ }
+ if service_name == 'url':
+ info['title'] = video_data['title']
+ else:
+ info.update({
'_type': 'url_transparent',
- 'ie_key': 'Youtube',
- 'id': yt_video_id,
- 'thumbnail': video_data.get('thumbnail'),
+ 'ie_key': service_name.capitalize(),
'title': video_data.get('title'),
- 'url': yt_video_id,
- }
- else:
- raise ExtractorError(
- 'Unsupported service name: {0}'.format(service_name), expected=True)
+ })
+ if service_name == 'vimeo':
+ info['url'] = smuggle_url(
+ 'https://player.vimeo.com/video/' + service_id,
+ {'http_headers': {'Referer': url}})
+ return info