1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-21 19:23:00 +08:00

[youtube] Construct a playlist URL in case the page is missing one

This fixes jumping from user/channel -> playlist for some users like
https://www.youtube.com/user/BitcoinFoundation

This also removes the superfluous log message
"add --no-playlist to just download video VIDEOID"
when downloading a user/channel.
This commit is contained in:
Ivan Kozik 2015-05-30 20:50:22 +00:00
parent c5138a7ce4
commit d2a9de78df

View File

@ -1412,12 +1412,8 @@ class YoutubeChannelIE(InfoExtractor):
channel_page, 'channel id', default=None)
if channel_playlist_id and channel_playlist_id.startswith('UC'):
playlist_id = 'UU' + channel_playlist_id[2:]
channel_playlist = unescapeHTML(self._search_regex(
r'href="/?(watch\?v=[0-9A-Za-z_-]{11}&list=%s)"' % playlist_id,
channel_page, 'channel playlist URL', default=None))
if channel_playlist:
return self.url_result(
compat_urlparse.urljoin(url, '/%s' % channel_playlist), 'YoutubePlaylist')
compat_urlparse.urljoin(url, '/playlist?list=%s' % playlist_id), 'YoutubePlaylist')
channel_page = self._download_webpage(url, channel_id, 'Downloading page #1')
autogenerated = re.search(r'''(?x)