#!/bin/bash # # Title: YTDL List Downloader # Author: TheOuterLinux (https://theouterlinux.gitlab.io) # Purpose: To make it easier to download a bunch of videos from # youtube-dl supported websites # (https://ytdl-org.github.io/youtube-dl/supportedsites.html). # License: GPLv3 or newer # Last updated: 2021/02/15 if [ "$1" = "" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ] || [ "$1" = "/?" ] || [ ! -f "$1" ] then echo ''' Usage: ytlist "/path/to/existing/list.txt" [number of connections, ex: 10] **Please make sure to change to the directory you would like to download your videos to before running. If axel is not installed and/or no [number of connections] is supplied, just youtube-dl is used to grab videos. ''' else if [ "$2" = "" ] || [ "$2" = "1" ] || [ "$2" = "0" ] then echo "" echo "Using youtube-dl to grab videos..." echo "" while read URL; do youtube-dl "$URL" done <"$1" else if ! [[ $2 == ?(-)+([0-9]) ]] then echo ''' Usage: ytlist "/path/to/list.txt" [number of connections, ex: 10] **The second argument you supplied, aka [number of connections], must be an integer such as "10" without quotations, for example. ''' else if [ -f "/usr/bin/axel" ] then echo "" echo "Using youtube-dl and axel -n $2 to grab videos..." echo "" while read URL; do youtube-dl --external-downloader /usr/bin/axel --external-downloader-args '-n 10' "$URL" done <"$1" else echo "" echo "Using youtube-dl to grab videos..." echo "" while read URL; do youtube-dl "$URL" done <"$1" fi fi fi fi