1
0
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-12-19 07:57:18 +00:00

Merge pull request #5852 from ivan/make-playlist-url

[youtube] Construct a playlist URL in case the page is missing one
This commit is contained in:
Sergey M. 2015-05-31 02:19:00 +05:00
commit 002c0fb511

View File

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