aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/youtube.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-06-06 06:25:37 +0600
committerSergey M․ <dstftw@gmail.com>2015-06-06 06:25:37 +0600
commit3d8e9573a470594df6fa471dc33c4c4b938b668a (patch)
tree1ff837939abdd316e7a23bf6a9efb40e70f55de6 /youtube_dl/extractor/youtube.py
parent54eb81a087516e9d040bc1ad274c0a64b51dd1d1 (diff)
downloadyoutube-dl-3d8e9573a470594df6fa471dc33c4c4b938b668a.tar.xz
[youtube:channel] Improve channel id extraction (#5904)
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r--youtube_dl/extractor/youtube.py10
1 files changed, 6 insertions, 4 deletions
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'<meta itemprop="channelId" content="([^"]+)">',
- 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(