]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/tvigle.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / tvigle.py
index 180259abac795e3f27e221c6c0cb95afdfe768ec..6c982193d566d7aa65de9441db652268ed8eeffe 100644 (file)
@@ -1,8 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     ExtractorError,
@@ -18,6 +13,7 @@ class TvigleIE(InfoExtractor):
     IE_NAME = 'tvigle'
     IE_DESC = 'Интернет-телевидение Tvigle.ru'
     _VALID_URL = r'https?://(?:www\.)?(?:tvigle\.ru/(?:[^/]+/)+(?P<display_id>[^/]+)/$|cloud\.tvigle\.ru/video/(?P<id>\d+))'
+    _EMBED_REGEX = [r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1']
 
     _GEO_BYPASS = False
     _GEO_COUNTRIES = ['RU']
@@ -54,7 +50,7 @@ class TvigleIE(InfoExtractor):
     ]
 
     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')
 
@@ -124,7 +120,6 @@ def _real_extract(self, url):
                         'height': int_or_none(height),
                         'filesize': filesize,
                     })
-        self._sort_formats(formats)
 
         return {
             'id': video_id,