]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/ntvru.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / ntvru.py
index fe39657291a157fcf3a2116e45f4a532439d5fc2..1ab1be0f60f70690d0c26677be72bce50e259a8d 100644 (file)
@@ -102,7 +102,7 @@ def _real_extract(self, url):
                 self._VIDEO_ID_REGEXES, webpage, 'video id')
 
         player = self._download_xml(
-            'http://www.ntv.ru/vi%s/' % video_id,
+            f'http://www.ntv.ru/vi{video_id}/',
             video_id, 'Downloading video XML')
 
         title = strip_or_none(unescapeHTML(xpath_text(player, './data/title', 'title', fatal=True)))
@@ -111,7 +111,7 @@ def _real_extract(self, url):
 
         formats = []
         for format_id in ['', 'hi', 'webm']:
-            file_ = xpath_text(video, './%sfile' % format_id)
+            file_ = xpath_text(video, f'./{format_id}file')
             if not file_:
                 continue
             if file_.startswith('//'):
@@ -120,7 +120,7 @@ def _real_extract(self, url):
                 file_ = 'http://media.ntv.ru/vod/' + file_
             formats.append({
                 'url': file_,
-                'filesize': int_or_none(xpath_text(video, './%ssize' % format_id)),
+                'filesize': int_or_none(xpath_text(video, f'./{format_id}size')),
             })
         hls_manifest = xpath_text(video, './playback/hls')
         if hls_manifest: