Upgrade yt_dlp and download script
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
from .common import InfoExtractor
|
||||
from ..compat import compat_str
|
||||
from ..utils import (
|
||||
parse_iso8601,
|
||||
parse_duration,
|
||||
parse_iso8601,
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +9,7 @@ class SkyNewsArabiaBaseIE(InfoExtractor):
|
||||
_IMAGE_BASE_URL = 'http://www.skynewsarabia.com/web/images'
|
||||
|
||||
def _call_api(self, path, value):
|
||||
return self._download_json('http://api.skynewsarabia.com/web/rest/v2/%s/%s.json' % (path, value), value)
|
||||
return self._download_json(f'http://api.skynewsarabia.com/web/rest/v2/{path}/{value}.json', value)
|
||||
|
||||
def _get_limelight_media_id(self, url):
|
||||
return self._search_regex(r'/media/[^/]+/([a-z0-9]{32})', url, 'limelight media id')
|
||||
@@ -19,11 +18,11 @@ class SkyNewsArabiaBaseIE(InfoExtractor):
|
||||
return self._IMAGE_BASE_URL + image_path_template.format(width=width, height=height)
|
||||
|
||||
def _extract_video_info(self, video_data):
|
||||
video_id = compat_str(video_data['id'])
|
||||
video_id = str(video_data['id'])
|
||||
topic = video_data.get('topicTitle')
|
||||
return {
|
||||
'_type': 'url_transparent',
|
||||
'url': 'limelight:media:%s' % self._get_limelight_media_id(video_data['videoUrl'][0]['url']),
|
||||
'url': 'limelight:media:{}'.format(self._get_limelight_media_id(video_data['videoUrl'][0]['url'])),
|
||||
'id': video_id,
|
||||
'title': video_data['headline'],
|
||||
'description': video_data.get('summary'),
|
||||
@@ -32,12 +31,13 @@ class SkyNewsArabiaBaseIE(InfoExtractor):
|
||||
'duration': parse_duration(video_data.get('runTime')),
|
||||
'tags': video_data.get('tags', []),
|
||||
'categories': [topic] if topic else [],
|
||||
'webpage_url': 'http://www.skynewsarabia.com/web/video/%s' % video_id,
|
||||
'webpage_url': f'http://www.skynewsarabia.com/web/video/{video_id}',
|
||||
'ie_key': 'LimelightMedia',
|
||||
}
|
||||
|
||||
|
||||
class SkyNewsArabiaIE(SkyNewsArabiaBaseIE):
|
||||
_WORKING = False
|
||||
IE_NAME = 'skynewsarabia:video'
|
||||
_VALID_URL = r'https?://(?:www\.)?skynewsarabia\.com/web/video/(?P<id>[0-9]+)'
|
||||
_TEST = {
|
||||
@@ -64,6 +64,7 @@ class SkyNewsArabiaIE(SkyNewsArabiaBaseIE):
|
||||
|
||||
|
||||
class SkyNewsArabiaArticleIE(SkyNewsArabiaBaseIE):
|
||||
_WORKING = False
|
||||
IE_NAME = 'skynewsarabia:article'
|
||||
_VALID_URL = r'https?://(?:www\.)?skynewsarabia\.com/web/article/(?P<id>[0-9]+)'
|
||||
_TESTS = [{
|
||||
@@ -99,7 +100,7 @@ class SkyNewsArabiaArticleIE(SkyNewsArabiaBaseIE):
|
||||
topic = article_data.get('topicTitle')
|
||||
return {
|
||||
'_type': 'url_transparent',
|
||||
'url': 'limelight:media:%s' % self._get_limelight_media_id(media_asset['videoUrl'][0]['url']),
|
||||
'url': 'limelight:media:{}'.format(self._get_limelight_media_id(media_asset['videoUrl'][0]['url'])),
|
||||
'id': article_id,
|
||||
'title': article_data['headline'],
|
||||
'description': article_data.get('summary'),
|
||||
|
Reference in New Issue
Block a user