]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/telemb.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / telemb.py
index 44d5d220b95724593db008b7bcf3d37e394e6fdc..664464844c83becb4ffe6275d8cc1f216928f458 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import re
 
 from .common import InfoExtractor
@@ -8,6 +5,7 @@
 
 
 class TeleMBIE(InfoExtractor):
+    _WORKING = False
     _VALID_URL = r'https?://(?:www\.)?telemb\.be/(?P<display_id>.+?)_d_(?P<id>\d+)\.html'
     _TESTS = [
         {
@@ -20,7 +18,7 @@ class TeleMBIE(InfoExtractor):
                 'title': 'Mons - Cook with Danielle : des cours de cuisine en anglais ! - Les reportages',
                 'description': 'md5:bc5225f47b17c309761c856ad4776265',
                 'thumbnail': r're:^http://.*\.(?:jpg|png)$',
-            }
+            },
         },
         {
             # non-ASCII characters in download URL
@@ -33,12 +31,12 @@ class TeleMBIE(InfoExtractor):
                 'title': 'Havré - Incendie mortel - Les reportages',
                 'description': 'md5:5e54cb449acb029c2b7734e2d946bd4a',
                 'thumbnail': r're:^http://.*\.(?:jpg|png)$',
-            }
+            },
         },
     ]
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
+        mobj = self._match_valid_url(url)
         video_id = mobj.group('id')
         display_id = mobj.group('display_id')
 
@@ -48,7 +46,7 @@ def _real_extract(self, url):
         for video_url in re.findall(r'file\s*:\s*"([^"]+)"', webpage):
             fmt = {
                 'url': video_url,
-                'format_id': video_url.split(':')[0]
+                'format_id': video_url.split(':')[0],
             }
             rtmp = re.search(r'^(?P<url>rtmp://[^/]+/(?P<app>.+))/(?P<playpath>mp4:.+)$', video_url)
             if rtmp:
@@ -60,7 +58,6 @@ def _real_extract(self, url):
                     'preference': -10,
                 })
             formats.append(fmt)
-        self._sort_formats(formats)
 
         title = remove_start(self._og_search_title(webpage), 'TéléMB : ')
         description = self._html_search_regex(