]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/zapiks.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / zapiks.py
index 161b011ab609a741287da56808f0e2b787866447..2916367c8279183b59e7269e588ee3391c877252 100644 (file)
@@ -1,20 +1,18 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import re
 
 from .common import InfoExtractor
 from ..utils import (
+    int_or_none,
     parse_duration,
     parse_iso8601,
-    xpath_with_ns,
     xpath_text,
-    int_or_none,
+    xpath_with_ns,
 )
 
 
 class ZapiksIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?zapiks\.(?:fr|com)/(?:(?:[a-z]{2}/)?(?P<display_id>.+?)\.html|index\.php\?.*\bmedia_id=(?P<id>\d+))'
+    _EMBED_REGEX = [r'<iframe[^>]+src="(?P<url>https?://(?:www\.)?zapiks\.fr/index\.php\?.+?)"']
     _TESTS = [
         {
             'url': 'http://www.zapiks.fr/ep2s3-bon-appetit-eh-be-viva.html',
@@ -57,11 +55,11 @@ def _real_extract(self, url):
                 r'data-media-id="(\d+)"', webpage, 'video id')
 
         playlist = self._download_xml(
-            'http://www.zapiks.fr/view/index.php?action=playlist&media_id=%s&lang=en' % video_id,
+            f'http://www.zapiks.fr/view/index.php?action=playlist&media_id={video_id}&lang=en',
             display_id)
 
         NS_MAP = {
-            'jwplayer': 'http://rss.jwpcdn.com/'
+            'jwplayer': 'http://rss.jwpcdn.com/',
         }
 
         def ns(path):
@@ -94,7 +92,6 @@ def ns(path):
             if m:
                 f['height'] = int(m.group('height'))
             formats.append(f)
-        self._sort_formats(formats)
 
         return {
             'id': video_id,