]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/dctp.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / dctp.py
index 24bb6aca2513bf38d0bd85e0a79ab2d8948fc4ef..09bdbf243af6a81cbc21c8eaee88787cb0ad9d07 100644 (file)
@@ -1,5 +1,4 @@
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..utils import (
     float_or_none,
     int_or_none,
@@ -37,18 +36,18 @@ def _real_extract(self, url):
         display_id = self._match_id(url)
 
         version = self._download_json(
-            '%s/version.json' % self._BASE_URL, display_id,
+            f'{self._BASE_URL}/version.json', display_id,
             'Downloading version JSON')
 
-        restapi_base = '%s/%s/restapi' % (
+        restapi_base = '{}/{}/restapi'.format(
             self._BASE_URL, version['version_name'])
 
         info = self._download_json(
-            '%s/slugs/%s.json' % (restapi_base, display_id), display_id,
+            f'{restapi_base}/slugs/{display_id}.json', display_id,
             'Downloading video info JSON')
 
         media = self._download_json(
-            '%s/media/%s.json' % (restapi_base, compat_str(info['object_id'])),
+            '{}/media/{}.json'.format(restapi_base, str(info['object_id'])),
             display_id, 'Downloading media JSON')
 
         uuid = media['uuid']
@@ -57,7 +56,7 @@ def _real_extract(self, url):
         formats = []
 
         def add_formats(suffix):
-            templ = 'https://%%s/%s_dctp_%s.m4v' % (uuid, suffix)
+            templ = f'https://%s/{uuid}_dctp_{suffix}.m4v'
             formats.extend([{
                 'format_id': 'hls-' + suffix,
                 'url': templ % 'cdn-segments.dctp.tv' + '/playlist.m3u8',