]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/toggle.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / toggle.py
index 70737337cfdf3662ed913639341eb5495521a137..de2e03f178c5834d47736c2156aa7b334e162584 100644 (file)
@@ -26,7 +26,7 @@ class ToggleIE(InfoExtractor):
         },
         'params': {
             'skip_download': 'm3u8 download',
-        }
+        },
     }, {
         'note': 'DRM-protected video',
         'url': 'http://www.mewatch.sg/en/movies/dug-s-special-mission/341413',
@@ -40,7 +40,7 @@ class ToggleIE(InfoExtractor):
         },
         'params': {
             'skip_download': 'DRM-protected wvm download',
-        }
+        },
     }, {
         # this also tests correct video id extraction
         'note': 'm3u8 links are geo-restricted, but Android/mp4 is okay',
@@ -56,7 +56,7 @@ class ToggleIE(InfoExtractor):
         'params': {
             'skip_download': 'DRM-protected wvm download',
         },
-        'skip': 'm3u8 links are geo-restricted'
+        'skip': 'm3u8 links are geo-restricted',
     }, {
         'url': 'http://video.toggle.sg/en/clips/seraph-sun-aloysius-will-suddenly-sing-some-old-songs-in-high-pitch-on-set/343331',
         'only_matching': True,
@@ -92,14 +92,14 @@ def _real_extract(self, url):
                     'LocaleLanguage': '',
                     'LocaleCountry': '',
                     'LocaleDevice': '',
-                    'LocaleUserState': 0
+                    'LocaleUserState': 0,
                 },
                 'Platform': 0,
                 'SiteGuid': 0,
                 'DomainID': '0',
                 'UDID': '',
                 'ApiUser': self._API_USER,
-                'ApiPass': self._API_PASS
+                'ApiPass': self._API_PASS,
             },
             'MediaID': video_id,
             'mediaType': 0,
@@ -107,7 +107,7 @@ def _real_extract(self, url):
 
         info = self._download_json(
             'http://tvpapi.as.tvinci.com/v2_9/gateways/jsonpostgw.aspx?m=GetMediaInfo',
-            video_id, 'Downloading video info json', data=json.dumps(params).encode('utf-8'))
+            video_id, 'Downloading video info json', data=json.dumps(params).encode())
 
         title = info['MediaName']
 
@@ -122,8 +122,8 @@ def _real_extract(self, url):
             if ext == 'm3u8':
                 m3u8_formats = self._extract_m3u8_formats(
                     video_url, video_id, ext='mp4', m3u8_id=vid_format,
-                    note='Downloading %s m3u8 information' % vid_format,
-                    errnote='Failed to download %s m3u8 information' % vid_format,
+                    note=f'Downloading {vid_format} m3u8 information',
+                    errnote=f'Failed to download {vid_format} m3u8 information',
                     fatal=False)
                 for f in m3u8_formats:
                     # Apple FairPlay Streaming
@@ -133,14 +133,14 @@ def _real_extract(self, url):
             elif ext == 'mpd':
                 formats.extend(self._extract_mpd_formats(
                     video_url, video_id, mpd_id=vid_format,
-                    note='Downloading %s MPD manifest' % vid_format,
-                    errnote='Failed to download %s MPD manifest' % vid_format,
+                    note=f'Downloading {vid_format} MPD manifest',
+                    errnote=f'Failed to download {vid_format} MPD manifest',
                     fatal=False))
             elif ext == 'ism':
                 formats.extend(self._extract_ism_formats(
                     video_url, video_id, ism_id=vid_format,
-                    note='Downloading %s ISM manifest' % vid_format,
-                    errnote='Failed to download %s ISM manifest' % vid_format,
+                    note=f'Downloading {vid_format} ISM manifest',
+                    errnote=f'Failed to download {vid_format} ISM manifest',
                     fatal=False))
             elif ext == 'mp4':
                 formats.append({