1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-12-28 14:35:51 +01:00

Merge branch 'master' into vimeo

This commit is contained in:
Rogério Brito 2011-02-17 09:17:30 -02:00
commit 7f69fd3b39

View File

@ -2213,7 +2213,7 @@ class YahooSearchIE(InfoExtractor):
class YoutubePlaylistIE(InfoExtractor):
"""Information Extractor for YouTube playlists."""
_VALID_URL = r'(?:http://)?(?:\w+\.)?youtube.com/(?:(?:view_play_list|my_playlists|artist)\?.*?(p|a)=|user/.*?/user/|p/)([^&]+).*'
_VALID_URL = r'(?:http://)?(?:\w+\.)?youtube.com/(?:(?:view_play_list|my_playlists|artist)\?.*?(p|a)=|user/.*?/user/|p/|user/.*?#[pg]/c/)([0-9A-Za-z]+)(?:/.*?/([0-9A-Za-z_-]+))?.*'
_TEMPLATE_URL = 'http://www.youtube.com/%s?%s=%s&page=%s&gl=US&hl=en'
_VIDEO_INDICATOR = r'/watch\?v=(.+?)&'
_MORE_PAGES_INDICATOR = r'(?m)>\s*Next\s*</a>'
@ -2241,12 +2241,18 @@ class YoutubePlaylistIE(InfoExtractor):
self._downloader.trouble(u'ERROR: invalid url: %s' % url)
return
# Single video case
if mobj.group(3) is not None:
self._youtube_ie.extract(mobj.group(3))
return
# Download playlist pages
# prefix is 'p' as default for playlists but there are other types that need extra care
playlist_prefix = mobj.group(1)
if playlist_prefix == 'a':
playlist_access = 'artist'
else:
playlist_prefix = 'p'
playlist_access = 'view_play_list'
playlist_id = mobj.group(2)
video_ids = []