-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtuo-install.sh
executable file
·71 lines (62 loc) · 1.37 KB
/
tuo-install.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
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
#!/bin/bash
starts() {
clear
if [[ ! -d "/data/data/com.termux/files/home" ]]; then
echo -e "This script is only for TERMUX\n"
echo -e "Please wait for another Update\n"
exit 0
fi
if [[ ! -d "$HOME/storage" ]]; then
echo -e "Setting up Storage\n"
echo -e "Please Allow Storage Permission\n"
sleep 2
termux-setup-storage
fi
}
install_pkgs() {
pkgs=(python mpv ffmpeg)
for i in "${pkgs[@]}"; do
if [[ ! $(command -v "$i") ]]; then
type -p "$i" &>/dev/null || {
echo -e "\nInstalling $i\n"
pkg install -y "$i"
sleep 1
}
fi
done
if [[ ! $(command -v pip3) ]]; then
curl -k --progress-bar -L "https://bootstrap.pypa.io/get-pip.py" -o "gpip.py"
python gpip.py
rm gpip.py
fi
if [[ ! $(command -v yt-dlp) ]]; then
pip3 install yt-dlp
fi
}
config_s() {
directory=("$HOME/bin" "$HOME/.config/yt-dlp" "/sdcard/YouTube")
for d in "${directory[@]}"; do
if [[ ! -d "$d" ]]; then
echo "Creating Directory : $d"
mkdir -p $d
fi
done
confs=("$HOME/bin/termux-url-opener" "$HOME/.config/yt-dlp/config")
for c in "${confs[@]}"; do
if [[ -e "$c" ]]; then
echo "Backing Up : $c"
mv $c "${c}.bak"
fi
if [[ -e $(basename $c) ]]; then
cp $(basename $c) "$c"
chmod 777 "$c"
else
echo -e "\nSome Config files not found,,,Clone Again\n"
exit 0
fi
done
echo -e "\nConfiguration Completed !!\n"
}
starts
install_pkgs
config_s