-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·90 lines (81 loc) · 2.08 KB
/
test.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/sh
##init
echo checking if python is installed
if [ ! -f /usr/bin/python3 ]; then
echo python is not installed bruh
exit
else
echo python installed...
if [ ! -f /usr/bin/jd ]; then
echo jd is not installed....
else
echo jd is installed...
fi
fi
echo passed!
echo checking if virtualenv is installed
if [ ! -f /usr/bin/pip ]; then
echo pip not installed...
exit
else
echo pip is installed...
python -m virtualenv
if [ $? -eq 2 ]; then
echo virtualenv module is installed
else
echo installing virtual env....
python -m pip virtualenv
fi
fi
echo passed!
if [ ! -d ./env/ ]; then
echo env not set yet, setting it up now....
python -m virtualenv env
. ./env/bin/activate
echo first time setup now....
python -m qbzremake.py -r
else
. ./env/bin/activate
fi
##env shit
first () {
clear
dateTime=$(date +"%Y-%m-%d")
echo "input qobuz url here:";
read;
python qbzremake.py dl --no-db "${REPLY}"
## Error checking
if [ ! $? -eq 0 ]; then
clear
echo something happened pls retry...
first
else
echo yes 0
fi
foldername=$(ls './Qobuz Downloads'/)
echo "$foldername" > foldername.txt
base64=$(base64 foldername.txt)
mv -f "./Qobuz Downloads/$foldername" "./"
zip -r "./pending_upload/$base64.zip" "$foldername"
#7za a -t7z -p$base64 "./pending_upload/temp.7z" "$foldername"
mv -f "./pending_upload/$base64.zip" "./final/"
mv -f "./$foldername" "uncompressed"
##curl -F "[email protected]" https://api.bayfiles.com/upload
##curl --upload-file "./pending_upload/$base64.7z" https://transfer.sh/$base64.7z
curl -F"file=@./final/$base64.zip" https://api.bayfiles.com/upload > pending_url.txt
finalURL=$(cat pending_url.txt | jq -r .data.file.url.short)
base64URL=$(echo "$finalURL" | base64)
clear
echo ================================================
echo "Link: $finalURL"
echo "Base64: $base64URL"
echo ================================================
echo "$foldername - $dateTime" >> final_urls.txt
echo "$finalURL ~ $base64URL" >> final_urls.txt
echo ================================================ >> final_urls.txt
read -p "Press Enter to download another one.."
clear
first
}
##lol
first