-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathyoutube-archive.sh
37 lines (32 loc) · 1.08 KB
/
youtube-archive.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
COMMAND="youtube-dl"
# If yt-dlp exists, automatically upgrade to it.
# It includes several improvements (such as fixing the 70 Kbps download cap) that make it a
# lot better to use compared to the traditional youtube-dl.
if command -v "yt-dlp" &> /dev/null
then
COMMAND="yt-dlp"
fi
download () {
local directory="/home/freshgum/YouTube Archives/$1"
mkdir -p "$directory"
pushd "$directory"
# Finally, download the channel from YouTube.
$COMMAND --playlist-reverse \
-o '%(playlist_index)s - %(title)s.%(ext)s' \
--write-annotations \
--download-archive .archive \
--add-metadata \
--write-info-json \
--write-thumbnail -f bestvideo[ext=vp9]+bestaudio[ext=opus]/bestvideo+bestaudio \
--merge-output-format mkv \
--all-subs \
--embed-subs \
-i \
--embed-thumbnail \
--http-chunk-size 10M \
"https://youtube.com/$2"
popd
}
download "Jim Can't Swim" c/JCSCriminalPsychology
download "PhotonicInduction" user/Photonvids