summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/skynewsarabia.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:10 +0000
commit7e21328585afda6d66f98ca476301680eeffac32 (patch)
tree266a4e7b20443f94572748781d71fc0375a15037 /yt_dlp/extractor/skynewsarabia.py
parentAdding upstream version 2024.05.27. (diff)
downloadyt-dlp-7e21328585afda6d66f98ca476301680eeffac32.tar.xz
yt-dlp-7e21328585afda6d66f98ca476301680eeffac32.zip
Adding upstream version 2024.07.01.upstream/2024.07.01
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--yt_dlp/extractor/skynewsarabia.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/yt_dlp/extractor/skynewsarabia.py b/yt_dlp/extractor/skynewsarabia.py
index 234703c..7ac2443 100644
--- a/yt_dlp/extractor/skynewsarabia.py
+++ b/yt_dlp/extractor/skynewsarabia.py
@@ -1,5 +1,4 @@
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
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,7 +31,7 @@ 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',
}
@@ -101,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'),