1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-06-02 10:29:28 +00:00

Enable additional playlist page type

Some user pages have a different playlist format, e.g.:
http://www.youtube.com/user/stanforduniversity#g/c/9D558D49CA734A02
Extract playlist id and turn the URL into a format that is already
understood.
This commit is contained in:
Gergely Imreh 2011-02-09 13:22:17 +08:00
parent f74e22ae28
commit 770267dd44

View file

@ -2096,7 +2096,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/.*g/c/)([^&]+).*'
_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>'
@ -2130,6 +2130,7 @@ class YoutubePlaylistIE(InfoExtractor):
if playlist_prefix == 'a':
playlist_access = 'artist'
else:
playlist_prefix = 'p'
playlist_access = 'view_play_list'
playlist_id = mobj.group(2)
video_ids = []