From: Sergey M․ Date: Sat, 6 Jun 2015 00:25:37 +0000 (+0600) Subject: [youtube:channel] Improve channel id extraction (#5904) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=3d8e9573a470594df6fa471dc33c4c4b938b668a;p=youtube-dl [youtube:channel] Improve channel id extraction (#5904) --- diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index aacb999ce..419f7b019 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1406,10 +1406,12 @@ class YoutubeChannelIE(InfoExtractor): channel_page = self._download_webpage( url + '?view=57', channel_id, 'Downloading channel page', fatal=False) - channel_playlist_id = self._search_regex( - [r'', - r'data-channel-external-id="([^"]+)"'], - channel_page, 'channel id', default=None) + 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'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:] return self.url_result(