-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions
107 lines (107 loc) · 5.14 KB
/
functions
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
music() {
origin=$1
genre=$2
artist=$3
type=$5
# log=$data_root/Music/$origin/$genre/$artist/download-log.log
archive=$data_root/Music/$origin/$genre/$artist/download-archive.txt
additional_options="$global_yt_options -i --no-continue --no-overwrites -x --audio-format mp3 --yes-playlist"
if [[ $type == "Concerts" ]]; then
output_syntax="$origin/"$genre"/"$artist"/$type/%(title)s.%(ext)s"
else
output_syntax="$origin/"$genre"/"$artist"/%(title)s.%(ext)s"
fi
echo "==================================================================================================================================" >> $log
echo "NEXT CHANNEL - Music - $origin - $genre - $artist" >> $log
echo "==================================================================================================================================" >> $log
yt-dlp --download-archive "$archive" $additional_options $4 -o "$data_root/Music/$output_syntax" >> $log 2>&1
unset origin
unset genre
unset artist
unset archive
unset channels
unset output_syntax
unset additional_options
}
music_videos() {
origin=$1
genre=$2
artist=$3
type=$5
archive=$data_root/Music-Videos/$origin/$genre/$artist/download-archive.txt
additional_options="$global_yt_options -vi --no-continue --no-overwrites --yes-playlist"
if [[ $type == "Concerts" ]]; then
output_syntax="$origin/"$genre"/"$artist"/$type/%(title)s.%(ext)s"
else
output_syntax="$origin/"$genre"/"$artist"/%(title)s.%(ext)s"
fi
echo "==================================================================================================================================" >> $log
echo "NEXT CHANNEL - Music - $origin - $genre - $artist" >> $log
echo "==================================================================================================================================" >> $log
yt-dlp --download-archive "$archive" $additional_options $4 -o "$data_root/Music-Videos/$output_syntax" >> $log 2>&1
unset origin
unset genre
unset artist
unset archive
unset channels
unset output_syntax
unset additional_options
}
documentary_playlist() {
genre=$1
channels=$2
archive=$data_root/Documentary/.$genre-download-archive.txt
additional_options="$global_yt_options --no-match-filters -vi --yes-playlist"
# Third argument is used for overriding the playlist name.
if [[ $3 ]]; then
output_syntax="$3/S%(upload_date>%Y)s-E%(playlist_index)s - %(title)s.%(ext)s"
else
output_syntax="%(playlist)s/S%(upload_date>%Y)s-E%(playlist_index)s - %(title)s.%(ext)s"
fi
echo "==================================================================================================================================" >> $log
echo "NEXT CHANNEL - $genre" >> $log
echo "==================================================================================================================================" >> $log
yt-dlp --config-location $config --download-archive $archive $additional_options "$channels" -o "$data_root/Documentary/$genre/$output_syntax" >> $log 2>&1
unset $genre
unset archive
unset channels
unset output_syntax
unset additional_options
}
documentary_single() {
genre=$1
channels=$2
# Third argument is used for overriding the documentary folder name.
archive=$data_root/Documentary/.$genre-download-archive.txt
additional_options="$global_yt_options --no-match-filters -vi --no-playlist"
if [[ $3 ]]; then
output_syntax="$3/%(title)s [%(resolution)s] (%(upload_date>%Y)s).%(ext)s"
else
output_syntax="%(title)s/%(title)s [%(resolution)s] (%(upload_date>%Y)s).%(ext)s"
fi
echo "==================================================================================================================================" >> $log
echo "NEXT CHANNEL - $genre" >> $log
echo "==================================================================================================================================" >> $log
yt-dlp --config-location $config --download-archive $archive $additional_options "$channels" -o "$data_root/Documentary/$genre/$output_syntax" >> $log 2>&1
unset $genre
unset archive
unset channels
unset output_syntax
unset additional_options
}
archive() {
genre=$1
channels=$2
archive=$data_root/Archive/.$genre-download-archive.txt
additional_options=$global_yt_options
output_syntax="%(channel)s/%(playlist)s/S%(upload_date>%Y)s-E%(upload_date>%m%d)s - [%(playlist_index)s] - %(title)s - [%(id)s].%(ext)s"
echo "==================================================================================================================================" >> $log
echo "NEXT CHANNEL - $genre" >> $log
echo "==================================================================================================================================" >> $log
yt-dlp --config-location $config --download-archive $archive $additional_options "$channels" -o "$data_root/Archive/$genre/$output_syntax" >> $log 2>&1
unset $genre
unset archive
unset channels
unset output_syntax
unset additional_options
}