mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-09 12:17:25 +08:00
Added support for ytuser:USERNAME argument format.
This commit is contained in:
parent
dc093a4bab
commit
6608d7fe62
@ -2117,7 +2117,7 @@ class YoutubePlaylistIE(InfoExtractor):
|
|||||||
class YoutubeUserIE(InfoExtractor):
|
class YoutubeUserIE(InfoExtractor):
|
||||||
"""Information Extractor for YouTube users."""
|
"""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'
|
_TEMPLATE_URL = 'http://gdata.youtube.com/feeds/api/users/%s'
|
||||||
_GDATA_PAGE_SIZE = 50
|
_GDATA_PAGE_SIZE = 50
|
||||||
_GDATA_URL = 'http://gdata.youtube.com/feeds/api/users/%s/uploads?max-results=%d&start-index=%d'
|
_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)
|
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
|
# 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.
|
# we need to query page by page until there are no video ids - it means we got all of them.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user