1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-03 23:43:21 -04:00

[extractor] Common function _match_valid_url

This commit is contained in:
pukkandan
2021-08-19 07:11:24 +05:30
parent f79ec47d71
commit 5ad28e7ffd
293 changed files with 389 additions and 541 deletions

View File

@@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
@@ -161,7 +160,7 @@ class RedBullTVRrnContentIE(InfoExtractor):
}]
def _real_extract(self, url):
region, lang, rrn_id = re.search(self._VALID_URL, url).groups()
region, lang, rrn_id = self._match_valid_url(url).groups()
rrn_id += ':%s-%s' % (lang, region.upper())
return self.url_result(
'https://www.redbull.com/embed/' + rrn_id,
@@ -204,7 +203,7 @@ class RedBullIE(InfoExtractor):
_LAT_FALLBACK_MAP = ['ar', 'bo', 'car', 'cl', 'co', 'mx', 'pe']
def _real_extract(self, url):
region, lang, filter_type, display_id = re.search(self._VALID_URL, url).groups()
region, lang, filter_type, display_id = self._match_valid_url(url).groups()
if filter_type == 'episodes':
filter_type = 'episode-videos'
elif filter_type == 'live':