aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelix <felix.von.s@posteo.de>2021-07-13 09:17:39 +0200
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-07-14 05:02:42 +0530
commit198f7ea89e89f0b3bc1f890cd4e5b98006fe9fa2 (patch)
tree4791937cd9d885497d47fad88af5d7c5261146fa
parentc888ffb95ab0ab4f4cd1d6c93eda014f80479551 (diff)
downloadhypervideo-pre-198f7ea89e89f0b3bc1f890cd4e5b98006fe9fa2.tar.lz
hypervideo-pre-198f7ea89e89f0b3bc1f890cd4e5b98006fe9fa2.tar.xz
hypervideo-pre-198f7ea89e89f0b3bc1f890cd4e5b98006fe9fa2.zip
[extractor] Allow extracting multiple groups in `_search_regex`
From #497, Authored by: fstirlitz
-rw-r--r--yt_dlp/extractor/common.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 8ad657fe5..81b88e4fa 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -1111,6 +1111,8 @@ class InfoExtractor(object):
if group is None:
# return the first matching group
return next(g for g in mobj.groups() if g is not None)
+ elif isinstance(group, (list, tuple)):
+ return tuple(mobj.group(g) for g in group)
else:
return mobj.group(group)
elif default is not NO_DEFAULT: