[YouTube] Avoid crash if uploader_id extraction fails
authordirkf <fieldhouse@gmx.net>
Fri, 17 Feb 2023 11:16:54 +0000 (11:16 +0000)
committerGitHub <noreply@github.com>
Fri, 17 Feb 2023 11:16:54 +0000 (11:16 +0000)
See #31530.

youtube_dl/extractor/youtube.py

index ba0f5c8b63c09988a660ecd9038c30d0329d6d50..66b0257df46aea28ea9c1120906cdc0058cfef01 100644 (file)
@@ -2122,7 +2122,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 microformat.get('uploadDate')
                 or search_meta('uploadDate')),
             'uploader': video_details['author'],
-            'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
+            'uploader_id': self._search_regex(
+                r'/(?:channel|user)/([^/?&#]+)', owner_profile_url,
+                'uploader id', fatal=False) if owner_profile_url else None,
             'uploader_url': owner_profile_url,
             'channel_id': channel_id,
             'channel_url': 'https://www.youtube.com/channel/' + channel_id if channel_id else None,