aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r--yt_dlp/extractor/common.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index b8347fe4c..317aa270e 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -3665,11 +3665,18 @@ class InfoExtractor:
t['name'] = cls.ie_key()
yield t
+ @classmethod
+ def get_webpage_testcases(cls):
+ tests = getattr(cls, '_WEBPAGE_TESTS', [])
+ for t in tests:
+ t['name'] = cls.ie_key()
+ return tests
+
@classproperty
def age_limit(cls):
"""Get age limit from the testcases"""
return max(traverse_obj(
- tuple(cls.get_testcases(include_onlymatching=False)),
+ (*cls.get_testcases(include_onlymatching=False), *cls.get_webpage_testcases()),
(..., (('playlist', 0), None), 'info_dict', 'age_limit')) or [0])
@classmethod
@@ -3844,7 +3851,10 @@ class InfoExtractor:
def extract_from_webpage(cls, ydl, url, webpage):
ie = (cls if isinstance(cls._extract_from_webpage, types.MethodType)
else ydl.get_info_extractor(cls.ie_key()))
- yield from ie._extract_from_webpage(url, webpage) or []
+ for info in ie._extract_from_webpage(url, webpage) or []:
+ # url = None since we do not want to set (webpage/original)_url
+ ydl.add_default_extra_info(info, ie, None)
+ yield info
@classmethod
def _extract_from_webpage(cls, url, webpage):