1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-30 04:08:01 +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): class YoutubePlaylistIE(InfoExtractor):
"""Information Extractor for YouTube playlists.""" """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' _TEMPLATE_URL = 'http://www.youtube.com/%s?%s=%s&page=%s&gl=US&hl=en'
_VIDEO_INDICATOR = r'/watch\?v=(.+?)&' _VIDEO_INDICATOR = r'/watch\?v=(.+?)&'
_MORE_PAGES_INDICATOR = r'(?m)>\s*Next\s*</a>' _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) self._downloader.trouble(u'ERROR: invalid url: %s' % url)
return return
# Single video case
if mobj.group(3) is not None:
self._youtube_ie.extract(mobj.group(3))
return
# Download playlist pages # Download playlist pages
# prefix is 'p' as default for playlists but there are other types that need extra care # prefix is 'p' as default for playlists but there are other types that need extra care
playlist_prefix = mobj.group(1) playlist_prefix = mobj.group(1)
if playlist_prefix == 'a': if playlist_prefix == 'a':
playlist_access = 'artist' playlist_access = 'artist'
else: else:
playlist_prefix = 'p'
playlist_access = 'view_play_list' playlist_access = 'view_play_list'
playlist_id = mobj.group(2) playlist_id = mobj.group(2)
video_ids = [] video_ids = []