Skip to content

Instantly share code, notes, and snippets.

@ddieppa
Last active February 24, 2022 18:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddieppa/758d36ea9dc04ecf9d42 to your computer and use it in GitHub Desktop.
Save ddieppa/758d36ea9dc04ecf9d42 to your computer and use it in GitHub Desktop.
Command to download videos from a list containing the urls to the videos using youtube-dl. Have to have installed youtube-dl, you can use chocolatey for that.

tu### Download from a list of files url usin Youtube-dl

choco install -y youtube-dl
choco install -y aria2
choco install -y ffmpeg

youtube-dl -v -i -c --add-metadata --write-info-json --write-all-thumbnails --embed-thumbnail -o "%(title)s.%(ext)s" --external-downloader aria2c --external-downloader-args "-x 16 -s 16" --download-archive _downloaded.txt -a {\\path\to\list.txt} --config-location PATH

with config file

youtube-dl --config-location youtube-dl.config

  • Complex

youtube-dl -v -i -c --add-metadata --write-info-json -o "%(title)s.%(ext)s" -a {\\path\to\list.txt}

  • Simple

youtube-dl -v -i -c --write-info-json -a "{\\path\to\list.txt}"

-v # Print various debugging information
#Continue on download errors, for example to skip unavailable videos in a playlist
-i #--ignore-errors
#Force resume of partially downloaded files.
#By default, youtube-dl will resume downloads if possible.
-c
--write-thumbnail #Write thumbnail image to disk
--add-metadata
--write-info-json
--write-all-thumbnails #Write all thumbnail image formats to disk
--embed-thumbnail
--write-description
-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'
--prefer-ffmpeg
#Output filename template, see the "OUTPUT TEMPLATE" for all the info
-o "%(title)s/%(title)s.%(ext)s" #--output TEMPLATE
--restrict-filenames #Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames
--external-downloader aria2c #Use the specified external downloader.
#Currently supports aria2c,avconv,axel,curl,ffmpeg,httpie,wget
--external-downloader-args "-x 16 -s 16" #Give these arguments to the external downloader
#Download only videos not listed in the archive file.
#Record the IDs of all downloaded videos in it.
--download-archive _downloaded.txt #--download-archive FILE
#File containing URLs to download ('-' for stdin), one URL per line.
#Lines starting with '#', ';' or ']' are as comments and ignored.
-a file-with-urls.txt #--batch-file FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment