[youtube] Fix uploader id and uploader URL extraction
authorSergey M․ <dstftw@gmail.com>
Mon, 15 Jun 2020 19:43:09 +0000 (02:43 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 15 Jun 2020 19:43:09 +0000 (02:43 +0700)
youtube_dl/extractor/youtube.py

index aaa4023b478e561027c98aa90d295971507ca385..ce2212a7caa13111e1d2835fa65be371a4937847 100644 (file)
@@ -2230,6 +2230,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         if mobj is not None:
             video_uploader_id = mobj.group('uploader_id')
             video_uploader_url = mobj.group('uploader_url')
+        else:
+            owner_profile_url = url_or_none(microformat.get('ownerProfileUrl'))
+            if owner_profile_url:
+                video_uploader_id = self._search_regex(
+                    r'(?:user|channel)/([^/]+)', owner_profile_url, 'uploader id',
+                    default=None)
+                video_uploader_url = owner_profile_url
 
         channel_id = (
             str_or_none(video_details.get('channelId'))