diff options
author | Jesús <heckyel@hyperbola.info> | 2022-04-10 07:57:14 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-04-10 07:57:14 +0800 |
commit | c8046abd97bae36fa50320c32843cf6141752f93 (patch) | |
tree | 1dd684a1936a08e7d5229dfb99f2d6d7fb604559 /yt_dlp/extractor/common.py | |
parent | 40748dd6d0bb053a1c90bcfe874d3cee4b306744 (diff) | |
parent | ca5300c7edadad46ede0249ad9fa8feaa4ccddd4 (diff) | |
download | hypervideo-pre-c8046abd97bae36fa50320c32843cf6141752f93.tar.lz hypervideo-pre-c8046abd97bae36fa50320c32843cf6141752f93.tar.xz hypervideo-pre-c8046abd97bae36fa50320c32843cf6141752f93.zip |
updated from upstream | 10/04/2022 at 07:57
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 6 |
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: |