1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-09 08:57:17 +08:00

Update youtube.py

This commit is contained in:
Sergey M 2019-05-09 00:58:00 +07:00 committed by GitHub
parent 850043babb
commit ddc928571a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2100,12 +2100,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
else:
self._downloader.report_warning('unable to extract uploader nickname')
channel_id = None
if video_details:
channel_id = str_or_none(video_details.get('channelId'))
if channel_id is None:
channel_id = self._html_search_meta(
'channelId', video_webpage, 'channel id')
channel_id = (
str_or_none(video_details.get('channelId')) or
self._html_search_meta(
'channelId', video_webpage, 'channel id', default=None) or
self._search_regex(
r'data-channel-external-id=(["\'])(?P<id>(?:(?!\1).)+)\1',
video_webpage, 'channel id', default=None, group='id'))
channel_url = 'http://www.youtube.com/channel/%s' % channel_id if channel_id else None
# thumbnail image