]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/showroomlive.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / showroomlive.py
index ab1895311830a59a766a157df577b3b5dc64d60e..303f0b3cc03f17d6a2e687c93348e284f43c7a35 100644 (file)
@@ -1,5 +1,4 @@
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..utils import (
     ExtractorError,
     int_or_none,
@@ -24,18 +23,18 @@ def _real_extract(self, url):
              r'(?:profile|room)\?room_id\=(\d+)'), webpage, 'room_id')
 
         room = self._download_json(
-            urljoin(url, '/api/room/profile?room_id=%s' % room_id),
+            urljoin(url, f'/api/room/profile?room_id={room_id}'),
             broadcaster_id)
 
         is_live = room.get('is_onlive')
         if is_live is not True:
-            raise ExtractorError('%s is offline' % broadcaster_id, expected=True)
+            raise ExtractorError(f'{broadcaster_id} is offline', expected=True)
 
         uploader = room.get('performer_name') or broadcaster_id
         title = room.get('room_name') or room.get('main_name') or uploader
 
         streaming_url_list = self._download_json(
-            urljoin(url, '/api/live/streaming_url?room_id=%s' % room_id),
+            urljoin(url, f'/api/live/streaming_url?room_id={room_id}'),
             broadcaster_id)['streaming_url_list']
 
         formats = []
@@ -68,7 +67,7 @@ def _real_extract(self, url):
                 })
 
         return {
-            'id': compat_str(room.get('live_id') or broadcaster_id),
+            'id': str(room.get('live_id') or broadcaster_id),
             'title': title,
             'description': room.get('description'),
             'timestamp': int_or_none(room.get('current_live_started_at')),