-
Notifications
You must be signed in to change notification settings - Fork 2
/
installytdl
executable file
·29 lines (15 loc) · 1.11 KB
/
installytdl
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
#!/data/data/com.termux/files/usr/bin/bash
set -e
yes | termux-setup-storage > /dev/null
apt update
yes | pkg install python ffmpeg atomicparsley git
yes | pip install --upgrade yt-dlp
value="true"; key="allow-external-apps"; file="/data/data/com.termux/files/home/.termux/termux.properties"; mkdir -p "$(dirname "$file")"; chmod 700 "$(dirname "$file")"; if ! grep -E '^'"$key"'=.*' $file &>/dev/null; then [[ -s "$file" && ! -z "$(tail -c 1 "$file")" ]] && newline=$'\n' || newline=""; echo "$newline$key=$value" >> "$file"; else sed -i'' -E 's/^'"$key"'=.*/'"$key=$value"'/' $file; fi
rm -rf "$HOME/ytdl"
git clone --depth 1 -b main https://github.com/Practicalbutterfly5/ytdl.git "$HOME/ytdl"
mkdir -p "$HOME/bin"
cp "$HOME/ytdl/termux-url-opener" "$HOME/bin/"
mkdir -p /sdcard/Tasker/ytdl
cp "$HOME/ytdl/ytdl.prj.xml" /sdcard/Tasker/ytdl/
echo -e "\n\n------------------------------\nStarting to import Tasker project.\n------------------------------\n\n"
am start -n net.dinglisch.android.taskerm/com.joaomgcd.taskerm.datashare.import.ActivityImportTaskerDataFromXml -d "file:///sdcard/Tasker/ytdl/ytdl.prj.xml"