]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/mangomolo.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / mangomolo.py
index efaf66fa200d123685e59b80f7ae1c2d07534695..2231f71e8f72441204c172bd3ce22320a0719559 100644 (file)
@@ -1,8 +1,7 @@
+import base64
+import urllib.parse
+
 from .common import InfoExtractor
-from ..compat import (
-    compat_b64decode,
-    compat_urllib_parse_unquote,
-)
 from ..utils import classproperty, int_or_none
 
 
@@ -33,14 +32,14 @@ def _get_real_id(self, page_id):
     def _real_extract(self, url):
         page_id = self._get_real_id(self._match_id(url))
         webpage = self._download_webpage(
-            'https://player.mangomolo.com/v1/%s?%s' % (self._TYPE, url.split('?')[1]), page_id)
+            'https://player.mangomolo.com/v1/{}?{}'.format(self._TYPE, url.split('?')[1]), page_id)
         hidden_inputs = self._hidden_inputs(webpage)
         m3u8_entry_protocol = 'm3u8' if self._IS_LIVE else 'm3u8_native'
 
         format_url = self._html_search_regex(
             [
                 r'(?:file|src)\s*:\s*"(https?://[^"]+?/playlist\.m3u8)',
-                r'<a[^>]+href="(rtsp://[^"]+)"'
+                r'<a[^>]+href="(rtsp://[^"]+)"',
             ], webpage, 'format url')
         formats = self._extract_wowza_formats(
             format_url, page_id, m3u8_entry_protocol, ['smil'])
@@ -70,4 +69,4 @@ class MangomoloLiveIE(MangomoloBaseIE):
     _IS_LIVE = True
 
     def _get_real_id(self, page_id):
-        return compat_b64decode(compat_urllib_parse_unquote(page_id)).decode()
+        return base64.b64decode(urllib.parse.unquote(page_id)).decode()