]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/common.py
[youtube] Fix uploader for collaborative playlists (#3332)
[yt-dlp.git] / yt_dlp / extractor / common.py
index e2605c1f4530f3b226131c10149c8a72b1bc7f38..9914910d0149aff9f46c6e56d39bca5078b2842c 100644 (file)
@@ -23,6 +23,7 @@
     compat_getpass,
     compat_http_client,
     compat_os_name,
+    compat_Pattern,
     compat_str,
     compat_urllib_error,
     compat_urllib_parse_unquote,
@@ -41,7 +42,6 @@
     base_url,
     bug_reports_message,
     clean_html,
-    compiled_regex_type,
     determine_ext,
     determine_protocol,
     dict_get,
@@ -1203,7 +1203,9 @@ def _search_regex(self, pattern, string, name, default=NO_DEFAULT, fatal=True, f
         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: