[youtube:channel] Improve channel id extraction (#5904)

This commit is contained in:
Sergey M․ 2015-06-06 06:25:37 +06:00
parent 54eb81a087
commit 3d8e9573a4

View File

@ -1406,9 +1406,11 @@ class YoutubeChannelIE(InfoExtractor):
channel_page = self._download_webpage(
url + '?view=57', channel_id,
'Downloading channel page', fatal=False)
channel_playlist_id = self._html_search_meta(
'channelId', channel_page, 'channel id', default=None)
if not channel_playlist_id:
channel_playlist_id = self._search_regex(
[r'<meta itemprop="channelId" content="([^"]+)">',
r'data-channel-external-id="([^"]+)"'],
r'data-channel-external-id="([^"]+)"',
channel_page, 'channel id', default=None)
if channel_playlist_id and channel_playlist_id.startswith('UC'):
playlist_id = 'UU' + channel_playlist_id[2:]