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

Added support for ytuser:USERNAME argument format.

This commit is contained in:
Paweł Paprota 2011-01-28 10:19:56 +01:00
parent dc093a4bab
commit 6608d7fe62

View file

@ -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.