-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbash_youtube-dl
74 lines (57 loc) · 1.52 KB
/
bash_youtube-dl
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
## VERIFYING ALL DEPENDENCIES ARE INSTALLED
# verify python3 is installed
if which python3 > /dev/null; then
: # Python3 is installed!
else
echo -e "\n Installing Python3 \n"
sudo apt install -yf python3
fi
# verify pip is installed
if which pip > /dev/null; then
: # PIP is installed!
else
echo -e "\n Installing PIP \n"
sudo apt install -yf python3-pip
fi
# verify axel is installed
if which axel > /dev/null; then
: # AXEL is installed!
else
echo -e "\n Installing AXEL \n"
sudo apt install -yf axel
fi
# verify ffmpeg is installed
if which ffmpeg > /dev/null; then
: # FFMPEG is installed!
else
echo -e "\n Installing FFMPEG \n"
sudo apt install -yf ffmpeg
fi
# verify youtube-dl is installed
if which youtube-dl > /dev/null; then
: # Youtube-dl is installed!
else
echo -e "\n Installing Youtube-dl \n"
pip install youtube-dl
sudo -H pip install --upgrade youtube-dl
fi
## DONE VERIFYING ALL DEPENDENCIES ARE INSTALLED
# -----------------------------------------------
## VARIABLES FOR Youtube-dl
# Youtube-dl
bd="--external-downloader axel --external-downloader-args '-a -n 8' "
ba="-x -f 'bestaudio[ext=m4a]' "
bv="-f 'bestvideo[ext=mp4]' "
## END OF VARIABLES FOR Youtube-dl
# ------------------------------------------------
## ALIASES FOR Youtube-dl
# Normal download
alias yt="youtube-dl $bd -cit "
# Audio download
alias ya="yt $ba"
alias yap="ya --yes-playlist"
# Video download
alias yv="yt $bv"
alias yvp="yv --yes-playlist"
## END OF ALIASES FOR Youtube-dl
# -----------------------------------------------