-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtermux-url-opener
executable file
·71 lines (62 loc) · 1.62 KB
/
termux-url-opener
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
#!/bin/bash
##Whole code is fully written by BDhaCkers009 please dont copy or if you copy then give credit
url=$1
location="/sdcard/Youtube"
pak() {
#### spspecial thanks to this blog ####https://joel28.ml/2021/yt-dlp-on-android-using-termux.html
echo "Video Resolution:-"
echo "[1] Download Video in 720p or 720p60fps"
echo
echo
echo "[2] Download video in 1080p or 1080p60fps"
echo
echo
echo
read -p "Select resolution (default 1): " res
if [[ ${res} == "1" ]]; then
sed -i 's/299/298/' $HOME/.config/yt-dlp/config && sed -i 's/137/136/' $HOME/.config/yt-dlp/config
elif [[ ${res} == "2" ]]; then
sed -i 's/298/299/' $HOME/.config/yt-dlp/config && sed -i 's/136/137/' $HOME/.config/yt-dlp/config
else
sed -i 's/299/298/' $HOME/.config/yt-dlp/config && sed -i 's/137/136/' $HOME/.config/yt-dlp/config
fi
echo "Downloading video,wait.."
echo ""
echo ""
echo "Downloading Video in ${location}"
sleep 3
clear
yt-dlp ${url}
}
echo "Options:- "
echo ""
echo "[1] play audio (without download)"
echo ""
echo "[2] download video (with yt-dlp)"
echo ""
echo "[3] download only audio (bestaudio quality)"
echo
echo "[4] download only audio (mp3)"
echo
echo
read -p "Select Option (default 1): " select
echo ""
if [ ${select} == "1" ]; then
echo "playing audio,wait..."
clear
mpv ${url}
elif [ ${select} == "2" ]; then
if [[ -d ${location} ]]; then
pak
else
mkdir ${location}
pak
fi
elif [[ ${select} == "3" ]]; then
yt-dlp -f 'ba' ${url} --sponsorblock-remove all
elif [[ ${select} == "4" ]]; then
yt-dlp -f 'ba' -x --audio-format mp3 ${url} --sponsorblock-remove all
else
clear
mpv ${url}
fi