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.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index e2605c1f4..9914910d0 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -23,6 +23,7 @@ from ..compat import (
compat_getpass,
compat_http_client,
compat_os_name,
+ compat_Pattern,
compat_str,
compat_urllib_error,
compat_urllib_parse_unquote,
@@ -41,7 +42,6 @@ from ..utils import (
base_url,
bug_reports_message,
clean_html,
- compiled_regex_type,
determine_ext,
determine_protocol,
dict_get,
@@ -1203,7 +1203,9 @@ class InfoExtractor(object):
In case of failure return a default value or raise a WARNING or a
RegexNotFoundError, depending on fatal, specifying the field name.
"""
- if isinstance(pattern, (str, compat_str, compiled_regex_type)):
+ if string is None:
+ mobj = None
+ elif isinstance(pattern, (str, compat_Pattern)):
mobj = re.search(pattern, string, flags)
else:
for p in pattern: