From 6608d7fe620195397cda088ab99ddb4db9ab8be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Paprota?= Date: Fri, 28 Jan 2011 10:19:56 +0100 Subject: [PATCH] Added support for ytuser:USERNAME argument format. --- youtube-dl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube-dl b/youtube-dl index 0c746ae6e..6ecf04615 100755 --- a/youtube-dl +++ b/youtube-dl @@ -2117,7 +2117,7 @@ class YoutubePlaylistIE(InfoExtractor): class YoutubeUserIE(InfoExtractor): """Information Extractor for YouTube users.""" - _VALID_URL = r'(?:http://)?(?:\w+\.)?youtube.com/user/(.*)' + _VALID_URL = r'(?:(?:http://)?(?:\w+\.)?youtube.com/user/(.*)|ytuser:([^\s]+))' _TEMPLATE_URL = 'http://gdata.youtube.com/feeds/api/users/%s' _GDATA_PAGE_SIZE = 50 _GDATA_URL = 'http://gdata.youtube.com/feeds/api/users/%s/uploads?max-results=%d&start-index=%d' @@ -2148,6 +2148,10 @@ class YoutubeUserIE(InfoExtractor): username = mobj.group(1) + if not username: + # Probably the second group matched - meaning that the argument in the format "ytuser:USERNAME" was used. + username = mobj.group(2) + # Download video ids using YouTube Data API. Result size per query is limited (currently to 50 videos) so # we need to query page by page until there are no video ids - it means we got all of them.