]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/saitosan.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / saitosan.py
index a5f05e1d0593daf06310632b8c7e8cffe5d46527..4ed919572f3079f5b77fa2959104d539a244e040 100644 (file)
@@ -47,15 +47,15 @@ def _real_extract(self, url):
         base += '&sid=' + sid
 
         self._download_webpage(base, b_id, note='Polling socket')
-        payload = '420["room_start_join",{"room_id":"%s"}]' % b_id
-        payload = '%s:%s' % (len(payload), payload)
+        payload = f'420["room_start_join",{{"room_id":"{b_id}"}}]'
+        payload = f'{len(payload)}:{payload}'
 
         self._download_webpage(base, b_id, data=payload, note='Polling socket with payload')
         response = self._download_socket_json(base, b_id, note='Polling socket')
         if not response.get('ok'):
             err = response.get('error') or {}
             raise ExtractorError(
-                '%s said: %s - %s' % (self.IE_NAME, err.get('code', '?'), err.get('msg', 'Unknown')) if err
+                '{} said: {} - {}'.format(self.IE_NAME, err.get('code', '?'), err.get('msg', 'Unknown')) if err
                 else 'The socket reported that the broadcast could not be joined. Maybe it\'s offline or the URL is incorrect',
                 expected=True, video_id=b_id)
 
@@ -71,5 +71,5 @@ def _real_extract(self, url):
             'formats': self._extract_m3u8_formats(m3u8_url, b_id, 'mp4', live=True),
             'thumbnail': m3u8_url.replace('av.m3u8', 'thumb'),
             'uploader': try_get(b_data, lambda x: x['broadcast_user']['name']),  # same as title
-            'is_live': True
+            'is_live': True,
         }