This commit is contained in:
Thomas Coleman 2020-10-22 05:50:24 +01:00 committed by GitHub
commit 335e36e5cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -864,6 +864,10 @@ class YoutubeDL(object):
elif result_type == 'url':
# We have to add extra_info to the results because it may be
# contained in a playlist
if ie_result.get('channel_image'):
extra_info['channel_image'] = ie_result.get('channel_image')
if ie_result.get('channel_title'):
extra_info['channel_title'] = ie_result.get('channel_title')
return self.extract_info(ie_result['url'],
download,
ie_key=ie_result.get('ie_key'),
@ -998,6 +1002,7 @@ class YoutubeDL(object):
'extractor_key': ie_result['extractor_key'],
}
extra.update(extra_info)
reason = self._match_entry(entry, incomplete=True)
if reason is not None:
self.to_screen('[download] ' + reason)

View File

@ -2971,6 +2971,7 @@ class YoutubeChannelIE(YoutubePlaylistBaseInfoExtractor):
channel_id = self._match_id(url)
url = self._build_template_url(url, channel_id)
extra_info = dict()
# Channel by page listing is restricted to 35 pages of 30 items, i.e. 1050 videos total (see #5778)
# Workaround by extracting as a playlist if managed to obtain channel playlist URL
@ -2981,6 +2982,10 @@ class YoutubeChannelIE(YoutubePlaylistBaseInfoExtractor):
if channel_page is False:
channel_playlist_id = False
else:
extra_info['channel_image'] = self._html_search_meta(
'og:image', channel_page, 'channel image', default=None)
extra_info['channel_title'] = self._html_search_meta(
'og:title', channel_page, 'channel title', default=None)
channel_playlist_id = self._html_search_meta(
'channelId', channel_page, 'channel id', default=None)
if not channel_playlist_id:
@ -2993,8 +2998,10 @@ class YoutubeChannelIE(YoutubePlaylistBaseInfoExtractor):
channel_url, 'channel id', default=None)
if channel_playlist_id and channel_playlist_id.startswith('UC'):
playlist_id = 'UU' + channel_playlist_id[2:]
return self.url_result(
url_result = self.url_result(
compat_urlparse.urljoin(url, '/playlist?list=%s' % playlist_id), 'YoutubePlaylist')
url_result.update(extra_info)
return url_result
channel_page = self._download_webpage(url, channel_id, 'Downloading page #1')
autogenerated = re.search(r'''(?x)