]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/anvato.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / anvato.py
index 0df50333c3e16a8e2dec2ad61a42f15c982b7900..bf3d60b5ee5eacbd207e4d2406f4ffb96d3fabbe 100644 (file)
@@ -238,7 +238,7 @@ class AnvatoIE(InfoExtractor):
         'gray': 'anvato_mcp_gray_web_prod_4c10f067c393ed8fc453d3930f8ab2b159973900',
         'hearst': 'anvato_mcp_hearst_web_prod_5356c3de0fc7c90a3727b4863ca7fec3a4524a99',
         'cbs': 'anvato_mcp_cbs_web_prod_02f26581ff80e5bda7aad28226a8d369037f2cbe',
-        'telemundo': 'anvato_mcp_telemundo_web_prod_c5278d51ad46fda4b6ca3d0ea44a7846a054f582'
+        'telemundo': 'anvato_mcp_telemundo_web_prod_c5278d51ad46fda4b6ca3d0ea44a7846a054f582',
     }
 
     def _generate_nfl_token(self, anvack, mcp_id):
@@ -255,7 +255,7 @@ def _generate_nfl_token(self, anvack, mcp_id):
       token
     }
   }
-}''' % (anvack, mcp_id),
+}''' % (anvack, mcp_id),  # noqa: UP031
             }).encode(), headers={
                 'Authorization': auth_token,
                 'Content-Type': 'application/json',
@@ -299,7 +299,7 @@ def _get_video_json(self, access_key, video_id, extracted_token):
 
         return self._download_json(
             video_data_url, video_id, transform_source=strip_jsonp, query=query,
-            data=json.dumps({'api': api}, separators=(',', ':')).encode('utf-8'))
+            data=json.dumps({'api': api}, separators=(',', ':')).encode())
 
     def _get_anvato_videos(self, access_key, video_id, token):
         video_data = self._get_video_json(access_key, video_id, token)
@@ -358,7 +358,7 @@ def _get_anvato_videos(self, access_key, video_id, token):
         for caption in video_data.get('captions', []):
             a_caption = {
                 'url': caption['url'],
-                'ext': 'tt' if caption.get('format') == 'SMPTE-TT' else None
+                'ext': 'tt' if caption.get('format') == 'SMPTE-TT' else None,
             }
             subtitles.setdefault(caption['language'], []).append(a_caption)
         subtitles = self._merge_subtitles(subtitles, hls_subs, vtt_subs)