add code from @glenn-slayden

this is the code from issue #9676
This commit is contained in:
minimally 2017-04-30 13:13:38 -05:00
parent 9edf47df7b
commit d9a2786c80

View File

@ -1455,6 +1455,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
# Start extracting information # Start extracting information
self.report_information_extraction(video_id) self.report_information_extraction(video_id)
# channel_id
mobj = re.search(r'itemprop="channelId" content="(UC[-_A-Za-z0-9]{21}[AQgw])"', video_webpage)
if mobj is not None:
video_channel_id = mobj.group(1)
else:
self._downloader.report_warning('unable to extract channelId')
video_channel_id = None
# uploader # uploader
if 'author' not in video_info: if 'author' not in video_info:
raise ExtractorError('Unable to extract uploader name') raise ExtractorError('Unable to extract uploader name')
@ -1773,6 +1781,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
return { return {
'id': video_id, 'id': video_id,
'channel_id': video_channel_id,
'uploader': video_uploader, 'uploader': video_uploader,
'uploader_id': video_uploader_id, 'uploader_id': video_uploader_id,
'uploader_url': video_uploader_url, 'uploader_url': video_uploader_url,