]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/filmon.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / filmon.py
index 69ca87c842f165bf91f31a3a6bc18f934ee4f098..af1de7ac83be7b0fe0866b334a75fe7e0b71ac64 100644 (file)
@@ -1,5 +1,4 @@
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..networking.exceptions import HTTPError
 from ..utils import (
     ExtractorError,
@@ -35,12 +34,12 @@ def _real_extract(self, url):
 
         try:
             response = self._download_json(
-                'https://www.filmon.com/api/vod/movie?id=%s' % video_id,
+                f'https://www.filmon.com/api/vod/movie?id={video_id}',
                 video_id)['response']
         except ExtractorError as e:
             if isinstance(e.cause, HTTPError):
                 errmsg = self._parse_json(e.cause.response.read().decode(), video_id)['reason']
-                raise ExtractorError('%s said: %s' % (self.IE_NAME, errmsg), expected=True)
+                raise ExtractorError(f'{self.IE_NAME} said: {errmsg}', expected=True)
             raise
 
         title = response['title']
@@ -124,10 +123,10 @@ def _real_extract(self, url):
         except ExtractorError as e:
             if isinstance(e.cause, HTTPError):
                 errmsg = self._parse_json(e.cause.response.read().decode(), channel_id)['message']
-                raise ExtractorError('%s said: %s' % (self.IE_NAME, errmsg), expected=True)
+                raise ExtractorError(f'{self.IE_NAME} said: {errmsg}', expected=True)
             raise
 
-        channel_id = compat_str(channel_data['id'])
+        channel_id = str(channel_data['id'])
         is_live = not channel_data.get('is_vod') and not channel_data.get('is_vox')
         title = channel_data['title']
 
@@ -155,7 +154,7 @@ def _real_extract(self, url):
         for name, width, height in self._THUMBNAIL_RES:
             thumbnails.append({
                 'id': name,
-                'url': 'http://static.filmon.com/assets/channels/%s/%s.png' % (channel_id, name),
+                'url': f'http://static.filmon.com/assets/channels/{channel_id}/{name}.png',
                 'width': width,
                 'height': height,
             })