]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/philharmoniedeparis.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / philharmoniedeparis.py
index 5ea2b639334629699993c79f0c65b887b9ef75be..310ea0f742d7823c695c5158888b062c3c457b33 100644 (file)
@@ -1,5 +1,4 @@
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..utils import try_get
 
 
@@ -48,7 +47,7 @@ def _real_extract(self, url):
         video_id = self._match_id(url)
 
         config = self._download_json(
-            'https://otoplayer.philharmoniedeparis.fr/fr/config/%s.json' % video_id, video_id, query={
+            f'https://otoplayer.philharmoniedeparis.fr/fr/config/{video_id}.json', video_id, query={
                 'id': video_id,
                 'lang': 'fr-FR',
             })
@@ -66,7 +65,7 @@ def extract_entry(source):
             formats = []
             for format_id in ('mobile', 'desktop'):
                 format_url = try_get(
-                    files, lambda x: x[format_id]['file'], compat_str)
+                    files, lambda x: x[format_id]['file'], str)
                 if not format_url or format_url in format_urls:
                     continue
                 format_urls.add(format_url)
@@ -75,7 +74,6 @@ def extract_entry(source):
                     m3u8_id='hls', fatal=False))
             if not formats and not self.get_param('ignore_no_formats'):
                 return
-            self._sort_formats(formats)
             return {
                 'title': title,
                 'formats': formats,
@@ -92,7 +90,7 @@ def extract_entry(source):
             entry = extract_entry(chapter)
             if entry is None:
                 continue
-            entry['id'] = '%s-%d' % (video_id, num)
+            entry['id'] = f'{video_id}-{num}'
             entries.append(entry)
 
         return self.playlist_result(entries, video_id, config.get('title'))