Update slideslive.py
This commit is contained in:
parent
0daa3d99ce
commit
ea80736188
@ -2,13 +2,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import ExtractorError
|
||||||
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 = [{
|
||||||
'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
|
'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
|
||||||
'md5': 'b29fcd6c6952d0c79c5079b0e7a07e6f',
|
'md5': 'b29fcd6c6952d0c79c5079b0e7a07e6f',
|
||||||
@ -26,11 +24,11 @@ class SlidesLiveIE(InfoExtractor):
|
|||||||
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,
|
url, video_id, headers={'Accept': 'application/json'})
|
||||||
headers={'Accept': 'application/json'})
|
|
||||||
service_name = video_data['video_service_name']
|
service_name = video_data['video_service_name']
|
||||||
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:
|
||||||
raise ExtractorError('Unsupported service name: {0}'.format(service_name), expected=True)
|
raise ExtractorError(
|
||||||
|
'Unsupported service name: {0}'.format(service_name), expected=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user