]> jfr.im git - yt-dlp.git/commitdiff
[extractor/youtube] Fix `uploader_id` extraction
authorbashonly <redacted>
Thu, 16 Feb 2023 14:51:45 +0000 (08:51 -0600)
committerbashonly <redacted>
Thu, 16 Feb 2023 14:51:45 +0000 (08:51 -0600)
Closes #6247
Authored by: bashonly

yt_dlp/extractor/youtube.py

index 95ca52b3ae1c3eb7b1cb4d25428963b779a97f8e..4dde4bbaa78b2c71edfff8baf46a6be3742a94b8 100644 (file)
@@ -4120,7 +4120,7 @@ def is_bad_format(fmt):
             'thumbnail': traverse_obj(original_thumbnails, (-1, 'url')),
             'description': video_description,
             'uploader': get_first(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', default=None),
             'uploader_url': owner_profile_url,
             'channel_id': channel_id,
             'channel_url': format_field(channel_id, None, 'https://www.youtube.com/channel/%s'),