-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmediaDownloader
executable file
·115 lines (89 loc) · 2.99 KB
/
mediaDownloader
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
108
109
110
111
112
113
114
115
#!/bin/bash
# youtube music downloader
msc() {
cd /sdcard/Download/Shared/
if [[ "$1" == *"."* ]]; then
yt-dlp "$1" --extractor-args youtube:player_client=android \
--throttled-rate 100K -x --embed-thumbnail -o "%(title)s.%(ext)s"
else
yt-dlp ytsearch:"$*" \
-x --embed-thumbnail -o "%(title)s.%(ext)s"
fi
}
# youtube video downloader
vid() {
cd /sdcard/Download/Shared/
if [[ "$1" == *"."* ]]; then
yt-dlp "$1" --extractor-args youtube:player_client=android \
--throttled-rate 100K -o "%(title)s.%(ext)s" \
-f 'best[filesize<300M]'
else
yt-dlp ytsearch:"$*" -o "%(title)s.%(ext)s"
fi
}
# spotify downloader
sp() {
trap 'rm .spot-dl; return' 2 3
cd /sdcard/Download/Shared/
spotdl "$*" --st 20 --dt 5 --output-format opus;
rm .spotdl-cache
}
# online youtube downloader
ovid() {
cd /sdcard/Download/Shared/
curl -# -O -J -L "https://projectlounge.pw/ytdl/download?url=$1"
}
# streamcenter.cc downloader
streamcenter() {
readarray -t links <<< $(curl -L "$*" | grep -Po '(?<=<div data-url="/streamer/).+(?=" class="player">)')
for i in "${links[@]}"; do
link=$(echo "$i" | base64 -d)
echo -e "\e[33m$link\e[0m"
yt-dlp "$link"
page=$(curl -L "$link")
echo "$page" | grep '.mp4\|.avi\|.mkv\|.av1\|.vp9\|.vp8'
sleep 1
done
}
# tidal downloader (ARCHIVED)
#td() {
#
# unset ids titles names albums duration popularity audioQuality choice lines
# if [[ -z "$1" ]]; then
# echo "No input"
# return
# fi
# query=$(printf '%s' "$*" | tr ' ' '-' )
# out=$(curl -s "https://api.tidal.com/v1/search/tracks?countryCode=US&query=$query" -H 'x-tidal-token: zU4XHVVkc2tDPo4t' | jq)
# readarray -t ids <<< $(grep -B2 '"duration":' <<< "$out" | grep -Po '(?<="id": )[0-9]+(?=,)')
# readarray -t titles <<< $(grep -B1 '"duration":' <<< "$out" | grep -Po '(?<="title": ").+(?=",)')
# readarray -t version <<< $(perl -pe 's:^(?=.): - :g' <<< "$(grep -Po '(?<="version": ").+(?=",)' <<< "$out")")
# readarray -t names <<< $(grep -A2 '"artist":' <<< "$out" | grep -Po '(?<="name": ").+(?=",)')
# readarray -t albums <<< $(grep -A2 '"album":' <<< "$out" | grep -Po '(?<="title": ").+(?=",)')
# readarray -t duration <<< $(grep -Po '(?<="duration": )[0-9]+(?=,)' <<< "$out")
# readarray -t popularity <<< $(grep -Po '(?<="popularity": )[0-9]+(?=,)' <<< "$out")
# readarray -t audioQuality <<< $(grep -Po '(?<="audioQuality": ").+(?=",)' <<< "$out")
#
# echo
# for ((i=0; i < "${#ids[@]}"; i++)); do
#
# case "${audioQuality[i]}" in
# "HIGH") num="${red}$i${NC}";;
# "HI_RES") num="${green}$i${NC}";;
# "LOSSLESS") num="${blue}$i${NC}";;
# *) num="$i"
# esac
#
# echo -e "$num : ${yellow}${popularity[i]}%${NC} • ${green}${duration[i]}${NC} • ${titles[i]}${version[i]}"
# echo -e " ${red}${names[i]}${NC} • ${blue}${albums[i]}${NC}"
# echo
#
# done
# read -p "Choice : " choice
# if [[ -z "$choice" ]]; then
# return
# fi
# tidal-dl -l "http://www.tidal.com/track/${ids[choice]}"
#
#}
#!/bin/bash