]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/coub.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / coub.py
index 9bab698a3d22f5c57f956cb1abe4e54ca96a4282..95ad66518fa0e3d0f3070a08da2164d500229d40 100644 (file)
@@ -44,11 +44,11 @@ def _real_extract(self, url):
         video_id = self._match_id(url)
 
         coub = self._download_json(
-            'http://coub.com/api/v2/coubs/%s.json' % video_id, video_id)
+            f'http://coub.com/api/v2/coubs/{video_id}.json', video_id)
 
         if coub.get('error'):
             raise ExtractorError(
-                '%s said: %s' % (self.IE_NAME, coub['error']), expected=True)
+                '{} said: {}'.format(self.IE_NAME, coub['error']), expected=True)
 
         title = coub['title']
 
@@ -80,7 +80,7 @@ def _real_extract(self, url):
                     continue
                 formats.append({
                     'url': item_url,
-                    'format_id': '%s-%s-%s' % (HTML5, kind, quality),
+                    'format_id': f'{HTML5}-{kind}-{quality}',
                     'filesize': int_or_none(item.get('size')),
                     'vcodec': 'none' if kind == 'audio' else None,
                     'acodec': 'none' if kind == 'video' else None,
@@ -100,7 +100,7 @@ def _real_extract(self, url):
         if mobile_url:
             formats.append({
                 'url': mobile_url,
-                'format_id': '%s-audio' % MOBILE,
+                'format_id': f'{MOBILE}-audio',
                 'source_preference': preference_key(MOBILE),
             })