aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-12-02 11:02:59 -0500
committerJesús <heckyel@hyperbola.info>2021-12-02 11:02:59 -0500
commit7739b37f957b098d237179534d1b8c20597d55b6 (patch)
treece76d6ff608ad30fa81375dd4210b996d3430a97 /yt_dlp/extractor
parentccf02e63e53e481824b56b4e05ab1c2a9558c9a7 (diff)
parent9bdd99cf39974bf19badc0dfc9ee7172ff198e98 (diff)
downloadhypervideo-pre-7739b37f957b098d237179534d1b8c20597d55b6.tar.lz
hypervideo-pre-7739b37f957b098d237179534d1b8c20597d55b6.tar.xz
hypervideo-pre-7739b37f957b098d237179534d1b8c20597d55b6.zip
updated from upstream | 02/12/2021 at 11:02
Diffstat (limited to 'yt_dlp/extractor')
-rw-r--r--yt_dlp/extractor/common.py13
-rw-r--r--yt_dlp/extractor/jamendo.py2
-rw-r--r--yt_dlp/extractor/trovo.py3
-rw-r--r--yt_dlp/extractor/youtube.py2
4 files changed, 7 insertions, 13 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 37e69d409..597db63d1 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -466,6 +466,8 @@ class InfoExtractor(object):
# we have cached the regexp for *this* class, whereas getattr would also
# match the superclass
if '_VALID_URL_RE' not in cls.__dict__:
+ if '_VALID_URL' not in cls.__dict__:
+ cls._VALID_URL = cls._make_valid_url()
cls._VALID_URL_RE = re.compile(cls._VALID_URL)
return cls._VALID_URL_RE.match(url)
@@ -3658,17 +3660,8 @@ class SearchInfoExtractor(InfoExtractor):
def _make_valid_url(cls):
return r'%s(?P<prefix>|[1-9][0-9]*|all):(?P<query>[\s\S]+)' % cls._SEARCH_KEY
- @classmethod
- def suitable(cls, url):
- return re.match(cls._make_valid_url(), url) is not None
-
def _real_extract(self, query):
- mobj = re.match(self._make_valid_url(), query)
- if mobj is None:
- raise ExtractorError('Invalid search query "%s"' % query)
-
- prefix = mobj.group('prefix')
- query = mobj.group('query')
+ prefix, query = self._match_valid_url(query).group('prefix', 'query')
if prefix == '':
return self._get_n_results(query, 1)
elif prefix == 'all':
diff --git a/yt_dlp/extractor/jamendo.py b/yt_dlp/extractor/jamendo.py
index 1db7c64af..755d9703b 100644
--- a/yt_dlp/extractor/jamendo.py
+++ b/yt_dlp/extractor/jamendo.py
@@ -59,7 +59,7 @@ class JamendoIE(InfoExtractor):
})[0]
def _real_extract(self, url):
- track_id, display_id = self._VALID_URL_RE.match(url).groups()
+ track_id, display_id = self._match_valid_url(url).groups()
# webpage = self._download_webpage(
# 'https://www.jamendo.com/track/' + track_id, track_id)
# models = self._parse_json(self._html_search_regex(
diff --git a/yt_dlp/extractor/trovo.py b/yt_dlp/extractor/trovo.py
index 9d49840a5..127a5d2dc 100644
--- a/yt_dlp/extractor/trovo.py
+++ b/yt_dlp/extractor/trovo.py
@@ -108,6 +108,7 @@ class TrovoVodIE(TrovoBaseIE):
'comments': 'mincount:8',
'categories': ['Grand Theft Auto V'],
},
+ 'skip': '404'
}, {
'url': 'https://trovo.live/clip/lc-5285890810184026005',
'only_matching': True,
@@ -198,7 +199,7 @@ class TrovoVodIE(TrovoBaseIE):
return info
-class TrovoChannelBaseIE(InfoExtractor):
+class TrovoChannelBaseIE(TrovoBaseIE):
def _get_vod_json(self, page, uid):
raise NotImplementedError('This method must be implemented by subclasses')
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index e4854bead..566edb38f 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -4545,7 +4545,7 @@ class YoutubeSearchIE(YoutubeTabBaseInfoExtractor, SearchInfoExtractor):
_TESTS = []
-class YoutubeSearchDateIE(SearchInfoExtractor, YoutubeTabBaseInfoExtractor):
+class YoutubeSearchDateIE(YoutubeTabBaseInfoExtractor, SearchInfoExtractor):
IE_NAME = YoutubeSearchIE.IE_NAME + ':date'
_SEARCH_KEY = 'ytsearchdate'
IE_DESC = 'YouTube search, newest videos first'