From d9a2786c80e5f63e5c4c61ae4db327dddb11093b Mon Sep 17 00:00:00 2001
From: minimally <Lemon@iMac.local>
Date: Sun, 30 Apr 2017 13:13:38 -0500
Subject: [PATCH] add code from @glenn-slayden

this is the code from issue #9676
---
 youtube_dl/extractor/youtube.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 480f403da..b6b5cc48e 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1455,6 +1455,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         # Start extracting information
         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
         if 'author' not in video_info:
             raise ExtractorError('Unable to extract uploader name')
@@ -1773,6 +1781,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
 
         return {
             'id': video_id,
+            'channel_id': video_channel_id,
             'uploader': video_uploader,
             'uploader_id': video_uploader_id,
             'uploader_url': video_uploader_url,