From 137f07c27a88b07df57df5b2cdebebe3c7722bac Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 5 Aug 2024 11:06:10 +0200 Subject: Merging upstream version 2024.07.01. Signed-off-by: Daniel Baumann --- yt_dlp/extractor/rts.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'yt_dlp/extractor/rts.py') diff --git a/yt_dlp/extractor/rts.py b/yt_dlp/extractor/rts.py index bce5cba..dc1e2d3 100644 --- a/yt_dlp/extractor/rts.py +++ b/yt_dlp/extractor/rts.py @@ -1,7 +1,6 @@ import re from .srgssr import SRGSSRIE -from ..compat import compat_str from ..utils import ( determine_ext, int_or_none, @@ -110,7 +109,7 @@ class RTSIE(SRGSSRIE): # XXX: Do not subclass from concrete IE { 'url': 'http://pages.rts.ch/emissions/passe-moi-les-jumelles/5624065-entre-ciel-et-mer.html', 'only_matching': True, - } + }, ] def _real_extract(self, url): @@ -120,7 +119,7 @@ class RTSIE(SRGSSRIE): # XXX: Do not subclass from concrete IE def download_json(internal_id): return self._download_json( - 'http://www.rts.ch/a/%s.html?f=json/article' % internal_id, + f'http://www.rts.ch/a/{internal_id}.html?f=json/article', display_id) all_info = download_json(media_id) @@ -149,7 +148,7 @@ class RTSIE(SRGSSRIE): # XXX: Do not subclass from concrete IE r'(?s)]+class="srg-player"[^>]+src="[^"]+urn:([^"]+)"', page) if videos: - entries = [self.url_result('srgssr:%s' % video_urn, 'SRGSSR') for video_urn in videos] + entries = [self.url_result(f'srgssr:{video_urn}', 'SRGSSR') for video_urn in videos] if entries: return self.playlist_result(entries, media_id, all_info.get('title')) @@ -196,7 +195,7 @@ class RTSIE(SRGSSRIE): # XXX: Do not subclass from concrete IE 'tbr': extract_bitrate(format_url), }) - download_base = 'http://rtsww%s-d.rts.ch/' % ('-a' if media_type == 'audio' else '') + download_base = 'http://rtsww{}-d.rts.ch/'.format('-a' if media_type == 'audio' else '') for media in info.get('media', []): media_url = media.get('url') if not media_url or re.match(r'https?://', media_url): @@ -215,7 +214,7 @@ class RTSIE(SRGSSRIE): # XXX: Do not subclass from concrete IE self._check_formats(formats, media_id) duration = info.get('duration') or info.get('cutout') or info.get('cutduration') - if isinstance(duration, compat_str): + if isinstance(duration, str): duration = parse_duration(duration) return { -- cgit v1.2.3