1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-07 04:10:12 +08:00

Add an option to download all music videos from a youtube user

This commit is contained in:
AlexandreHalbardier 2019-12-16 13:49:12 +01:00
parent 2dbc0967f2
commit d694c4eec5
3 changed files with 20 additions and 10 deletions

View File

@ -77,8 +77,8 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo
repairs broken URLs, but emits an error if
this is not possible instead of searching.
--ignore-config Do not read configuration files. When given
in the global configuration file
/etc/youtube-dl.conf: Do not read the user
in the global configuration file /etc
/youtube-dl.conf: Do not read the user
configuration in ~/.config/youtube-
dl/config (%APPDATA%/youtube-dl/config.txt
on Windows)
@ -108,8 +108,8 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo
proxy specified by --proxy (or none, if the
option is not present) is used for the
actual downloading.
--geo-bypass Bypass geographic restriction via faking
X-Forwarded-For HTTP header
--geo-bypass Bypass geographic restriction via faking X
-Forwarded-For HTTP header
--no-geo-bypass Do not bypass geographic restriction via
faking X-Forwarded-For HTTP header
--geo-bypass-country CODE Force bypass geographic restriction with
@ -130,6 +130,8 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo
specify range: "--playlist-items
1-3,7,10-13", it will download the videos
at index 1, 2, 3, 7, 10, 11, 12 and 13.
--user-music None Downloads all the music videos of a youtube
user (doesnt work if its a channel)
--match-title REGEX Download only matching titles (regex or
caseless sub-string)
--reject-title REGEX Skip download for matching titles (regex or
@ -258,12 +260,11 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo
jar in
--cache-dir DIR Location in the filesystem where youtube-dl
can store some downloaded information
permanently. By default
$XDG_CACHE_HOME/youtube-dl or
~/.cache/youtube-dl . At the moment, only
YouTube player files (for videos with
obfuscated signatures) are cached, but that
may change.
permanently. By default $XDG_CACHE_HOME
/youtube-dl or ~/.cache/youtube-dl . At the
moment, only YouTube player files (for
videos with obfuscated signatures) are
cached, but that may change.
--no-cache-dir Disable filesystem caching
--rm-cache-dir Delete all filesystem cache files

View File

@ -80,6 +80,11 @@ def _real_main(argv=None):
write_string(std_headers['User-Agent'] + '\n', out=sys.stdout)
sys.exit(0)
# When usermusic option is activated, no need for url
if opts.usermusic is not None:
url = "https://www.youtube.com/user/"+opts.usermusic+"/videos?view=64&flow=grid"
args.append(url)
# Batch file verification
batch_urls = []
if opts.batchfile is not None:

View File

@ -267,6 +267,10 @@ def parseOpts(overrideArguments=None):
'--playlist-items',
dest='playlist_items', metavar='ITEM_SPEC', default=None,
help='Playlist video items to download. Specify indices of the videos in the playlist separated by commas like: "--playlist-items 1,2,5,8" if you want to download videos indexed 1, 2, 5, 8 in the playlist. You can specify range: "--playlist-items 1-3,7,10-13", it will download the videos at index 1, 2, 3, 7, 10, 11, 12 and 13.')
selection.add_option(
'--user-music',
dest='usermusic',
help='Downloads all the music videos of a youtube user (doesnt work if its a channel)')
selection.add_option(
'--match-title',
dest='matchtitle', metavar='REGEX',