mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-22 10:11:52 +00:00
[slideslive] make the check for video_service_name case-insensitive(closes #17429)
This commit is contained in:
parent
93284ff2ea
commit
aa1d5eb905
1 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ from ..utils import ExtractorError
|
||||||
class SlidesLiveIE(InfoExtractor):
|
class SlidesLiveIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://slideslive\.com/(?P<id>[0-9]+)'
|
_VALID_URL = r'https?://slideslive\.com/(?P<id>[0-9]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
|
# video_service_name = YOUTUBE
|
||||||
'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
|
'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
|
||||||
'md5': 'b29fcd6c6952d0c79c5079b0e7a07e6f',
|
'md5': 'b29fcd6c6952d0c79c5079b0e7a07e6f',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
|
@ -19,14 +20,18 @@ class SlidesLiveIE(InfoExtractor):
|
||||||
'uploader_id': 'UC62SdArr41t_-_fX40QCLRw',
|
'uploader_id': 'UC62SdArr41t_-_fX40QCLRw',
|
||||||
'upload_date': '20170925',
|
'upload_date': '20170925',
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
# video_service_name = youtube
|
||||||
|
'url': 'https://slideslive.com/38903721/magic-a-scientific-resurrection-of-an-esoteric-legend',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
video_data = self._download_json(
|
video_data = self._download_json(
|
||||||
url, video_id, headers={'Accept': 'application/json'})
|
url, video_id, headers={'Accept': 'application/json'})
|
||||||
service_name = video_data['video_service_name']
|
service_name = video_data['video_service_name'].lower()
|
||||||
if service_name == 'YOUTUBE':
|
if service_name == 'youtube':
|
||||||
yt_video_id = video_data['video_service_id']
|
yt_video_id = video_data['video_service_id']
|
||||||
return self.url_result(yt_video_id, 'Youtube', video_id=yt_video_id)
|
return self.url_result(yt_video_id, 'Youtube', video_id=yt_video_id)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue