aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/testurl.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2023-06-22 10:02:38 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2023-06-22 13:31:07 +0530
commit812cdfa06c33a40e73a8e04b3e6f42c084666a43 (patch)
tree6745122f200a08950e350d7215e7cf55be55f128 /yt_dlp/extractor/testurl.py
parentcd810afe2ac5567c822b7424800fc470ef2d0045 (diff)
downloadhypervideo-pre-812cdfa06c33a40e73a8e04b3e6f42c084666a43.tar.lz
hypervideo-pre-812cdfa06c33a40e73a8e04b3e6f42c084666a43.tar.xz
hypervideo-pre-812cdfa06c33a40e73a8e04b3e6f42c084666a43.zip
[cleanup] Misc
Diffstat (limited to 'yt_dlp/extractor/testurl.py')
-rw-r--r--yt_dlp/extractor/testurl.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/yt_dlp/extractor/testurl.py b/yt_dlp/extractor/testurl.py
index 0da01aa53..3cf001776 100644
--- a/yt_dlp/extractor/testurl.py
+++ b/yt_dlp/extractor/testurl.py
@@ -8,7 +8,7 @@ class TestURLIE(InfoExtractor):
""" Allows addressing of the test cases as test:yout.*be_1 """
IE_DESC = False # Do not list
- _VALID_URL = r'test(?:url)?:(?P<extractor>.*?)(?:_(?P<num>[0-9]+))?$'
+ _VALID_URL = r'test(?:url)?:(?P<extractor>.*?)(?:_(?P<num>\d+|all))?$'
def _real_extract(self, url):
from . import gen_extractor_classes
@@ -36,6 +36,10 @@ class TestURLIE(InfoExtractor):
extractor = matching_extractors[0]
testcases = tuple(extractor.get_testcases(True))
+ if num == 'all':
+ return self.playlist_result(
+ [self.url_result(tc['url'], extractor) for tc in testcases],
+ url, f'{extractor.IE_NAME} tests')
try:
tc = testcases[int(num or 0)]
except IndexError:
@@ -43,4 +47,4 @@ class TestURLIE(InfoExtractor):
f'Test case {num or 0} not found, got only {len(testcases)} tests', expected=True)
self.to_screen(f'Test URL: {tc["url"]}')
- return self.url_result(tc['url'])
+ return self.url_result(tc['url'], extractor)