]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/viddler.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / viddler.py
index 642358433bbf9f3c3eb8df1c42a75e37ecdf6c03..40914774ab61d10c48597ef07068d5178bb8840a 100644 (file)
@@ -1,7 +1,3 @@
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     float_or_none,
@@ -11,6 +7,8 @@
 
 class ViddlerIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?viddler\.com/(?:v|embed|player)/(?P<id>[a-z0-9]+)(?:.+?\bsecret=(\d+))?'
+    _EMBED_REGEX = [r'<(?:iframe[^>]+?src|param[^>]+?value)=(["\'])(?P<url>(?:https?:)?//(?:www\.)?viddler\.com/(?:embed|player)/.+?)\1']
+
     _TESTS = [{
         'url': 'http://www.viddler.com/v/43903784',
         'md5': '9eee21161d2c7f5b39690c3e325fab2f',
@@ -75,7 +73,7 @@ class ViddlerIE(InfoExtractor):
     }]
 
     def _real_extract(self, url):
-        video_id, secret = re.match(self._VALID_URL, url).groups()
+        video_id, secret = self._match_valid_url(url).groups()
 
         query = {
             'video_id': video_id,
@@ -118,7 +116,6 @@ def _real_extract(self, url):
                 f['format_id'] = format_id + '-html5'
                 f['source_preference'] = 0
                 formats.append(f)
-        self._sort_formats(formats)
 
         categories = [
             t.get('text') for t in data.get('tags', []) if 'text' in t]