]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/ustudio.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / ustudio.py
index f6ce5b3577d7b929653e6dec493fd153ff04d97f..b5da88b26e41bc6ae88161b473120a4c33d34aad 100644 (file)
@@ -21,14 +21,14 @@ class UstudioIE(InfoExtractor):
             'thumbnail': r're:^https?://.*\.jpg$',
             'upload_date': '20111107',
             'uploader': 'Tony Farley',
-        }
+        },
     }
 
     def _real_extract(self, url):
         video_id, display_id = self._match_valid_url(url).groups()
 
         config = self._download_xml(
-            'http://v1.ustudio.com/embed/%s/ustudio/config.xml' % video_id,
+            f'http://v1.ustudio.com/embed/{video_id}/ustudio/config.xml',
             display_id)
 
         def extract(kind):
@@ -36,7 +36,7 @@ def extract(kind):
                 'url': unescapeHTML(item.attrib['url']),
                 'width': int_or_none(item.get('width')),
                 'height': int_or_none(item.get('height')),
-            } for item in config.findall('./qualities/quality/%s' % kind) if item.get('url')]
+            } for item in config.findall(f'./qualities/quality/{kind}') if item.get('url')]
 
         formats = extract('video')
 
@@ -74,13 +74,13 @@ class UstudioEmbedIE(InfoExtractor):
             'title': '5 Things IT Should Know About Video',
             'description': 'md5:93d32650884b500115e158c5677d25ad',
             'uploader_id': 'DeN7VdYRDKhP',
-        }
+        },
     }
 
     def _real_extract(self, url):
         uploader_id, video_id = self._match_valid_url(url).groups()
         video_data = self._download_json(
-            'http://app.ustudio.com/embed/%s/%s/config.json' % (uploader_id, video_id),
+            f'http://app.ustudio.com/embed/{uploader_id}/{video_id}/config.json',
             video_id)['videos'][0]
         title = video_data['name']
 
@@ -92,7 +92,7 @@ def _real_extract(self, url):
                     continue
                 height = int_or_none(quality.get('height'))
                 formats.append({
-                    'format_id': '%s-%dp' % (ext, height) if height else ext,
+                    'format_id': f'{ext}-{height}p' if height else ext,
                     'url': quality_url,
                     'width': int_or_none(quality.get('width')),
                     'height': height,