diff options
author | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2011-02-12 20:19:20 +0100 |
---|---|---|
committer | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2011-02-12 20:19:20 +0100 |
commit | d119b54df6a02d3985284c36586f6ff7e4cac969 (patch) | |
tree | fce4015504c0f7a05d88c95850c952dfe8ec2aec | |
parent | f74e22ae280ac1680251350c4672abfeb2a047fe (diff) |
Support more common YouTube playlist URLs
-rwxr-xr-x | youtube-dl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube-dl b/youtube-dl index dd875a38e..0f9724637 100755 --- a/youtube-dl +++ b/youtube-dl @@ -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/.*?#[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>' @@ -2124,6 +2124,11 @@ 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) |