You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tput setaf 2;echo"Don't forget to star me on GitHub if this script helped you! https://l.r33.space/crdl"
25
+
sleep 1
25
26
tput reset
26
27
exit 1
27
28
}
@@ -30,33 +31,295 @@ function cookie {
30
31
tput setaf 6;echo"First of all, let's identify you! If you want to use an account, please specify the path of your cookies.txt file. Not sure about what I am talking about? Check README for more details. https://l.r33.space/crdl"
31
32
tput setaf 5;echo"If you do not want to use an account, just press enter. Please keep in mind that without an account, you will not be able to download premium-only videos and maximum quality is 480p."
32
33
echo""
33
-
tput setaf 6;read -e -p "Path: " cookies
34
-
if [ -f$cookies ]
34
+
tput setaf 6;read -r -e -p "Path: " cookies
35
+
if [ !-f"$cookies" ]
35
36
then
36
37
echo""
37
-
tput setaf 2;echo"Yep, I found the file you specified!"
38
+
tput setaf 1;echo"You seem to have not specified a cookie file. Proceeding offline."
39
+
sleep 0.5
38
40
tput reset
39
-
download-cookie
41
+
quality_nocookie
40
42
else
41
43
echo""
42
-
tput setaf 1;echo"You seem to have not specified a cookie file. Maximum quality is 480p."
44
+
tput setaf 2;echo"Yep, I found the file you specified!"
45
+
sleep 0.5
43
46
tput reset
44
-
download-nocookie
47
+
quality_cookie
45
48
fi
46
49
}
47
50
48
-
functiondownloadcookie {
49
-
echotest
51
+
functionquality_cookie {
52
+
tput setaf 2;echo"Now, choose the quality you want to download."
53
+
echo""
54
+
tput setaf 6;echo"1) 480p"
55
+
echo"2) 720p"
56
+
echo"3) 1080p"
57
+
echo"4) Best quality possible"
58
+
echo"5) Go back"
59
+
echo"6) Exit"
60
+
echo""
61
+
while [[ $OPTION0!="1"&&$OPTION0!="2"&&$OPTION0!="3"&&$OPTION0!="4"&&$OPTION0!="5"&&$OPTION0!="6" ]];do
62
+
read -r -p "Select an option [1-5]: " OPTION0
63
+
done
64
+
quality_cookie2
65
+
}
66
+
67
+
functionquality_cookie2 {
68
+
case$OPTION0in
69
+
1) #480p
70
+
quality="480"
71
+
link
72
+
;;
73
+
2) #720p
74
+
quality="720"
75
+
link
76
+
;;
77
+
3) #1080p
78
+
quality="1080"
79
+
link
80
+
;;
81
+
4) #Best quality possible
82
+
quality="best"
83
+
link
84
+
;;
85
+
5) #Go back
86
+
OPTION0=""
87
+
tput reset
88
+
cookie
89
+
;;
90
+
6) #Exit
91
+
quit
92
+
;;
93
+
esac
94
+
}
95
+
96
+
97
+
functionquality_nocookie {
98
+
tput setaf 2;echo"Now, choose the quality you want to download."
99
+
echo""
100
+
tput setaf 6;echo"1) 480p"
101
+
echo"2) Go back"
102
+
echo"3) Exit"
103
+
echo""
104
+
while [[ $OPTION1!="1"&&$OPTION1!="2"&&$OPTION1!="3" ]];do
105
+
read -r -p "Select an option [1-3]: " OPTION1
106
+
done
107
+
quality_nocookie2
108
+
}
109
+
110
+
functionquality_nocookie2 {
111
+
case$OPTION1in
112
+
1) #480p
113
+
quality="480"
114
+
link
115
+
;;
116
+
2) #Go back
117
+
OPTION1=""
118
+
tput reset
119
+
cookie
120
+
;;
121
+
3) #Exit
122
+
quit
123
+
;;
124
+
esac
125
+
}
126
+
127
+
functionlink {
128
+
tput reset;tput setaf 6
129
+
echo"Enter the URL of the video you want do download. If you want to download an entiere series, enter its link."
tput setaf 1;echo"This link seems to be invalid. Make sure you entered a valid Crunchyroll link."
163
+
sleep 0.8
164
+
download
165
+
fi
54
166
}
55
167
56
168
functionpath {
57
-
echotest
169
+
tput reset
170
+
tput setaf 6;echo"Where do you want to save your file? Empty input will save to the script's folder."
171
+
echo""
172
+
read -r -e -p "Path: " path
173
+
tput reset
174
+
sleep 0.2
175
+
language
176
+
}
177
+
178
+
functionlanguage {
179
+
tput setaf 6;echo"Choose the language you want to download subtitles for. Subtitles will be saved in a separate .ass file"
180
+
tput setaf 1;echo"Not all languages may be available for all videos, so check availability before choosing. Please let me know if there is any missing language by opening an issue. https://l.r33.space/crdlissue"
181
+
echo"";tput setaf 6
182
+
echo"1) English (US)"
183
+
echo"2) English (UK)"
184
+
echo"3) Arabic"
185
+
echo"4) French"
186
+
echo"5) German"
187
+
echo"6) Italian"
188
+
echo"7) Portuguese (Brasil)"
189
+
echo"8) Portuguese (Portugal)"
190
+
echo"9) Russian"
191
+
echo"10) Spanish"
192
+
echo"11) Spanish (Spain)"
193
+
echo"12) Go back"
194
+
echo"13) Exit"
195
+
echo""
196
+
while [[ $OPTION2!="1"&&$OPTION2!="2"&&$OPTION2!="3"&&$OPTION2!="4"&&$OPTION2!="5"&&$OPTION2!="6"&&$OPTION2!="7"&&$OPTION2!="8"&&$OPTION2!="9"&&$OPTION2!="10"&&$OPTION2!="11"&&$OPTION2!="12"&&$OPTION2!="13" ]];do
197
+
read -r -p "Select an option [1-13]: " OPTION2
198
+
done
199
+
language2
200
+
}
201
+
202
+
functionlanguage2 {
203
+
case$OPTION2in
204
+
1) #English (US)
205
+
language="enUS"
206
+
download
207
+
;;
208
+
2) #English (UK)
209
+
language="enGB"
210
+
download
211
+
;;
212
+
3) #Arabic
213
+
language="arME"
214
+
download
215
+
;;
216
+
4) #French
217
+
language="frFR"
218
+
download
219
+
;;
220
+
5) #German
221
+
language="deDE"
222
+
download
223
+
;;
224
+
6) #Italian
225
+
language="itIT"
226
+
download
227
+
;;
228
+
7) #Portuguese (Brasil)
229
+
language="ptBR"
230
+
download
231
+
;;
232
+
8) #Portuguese (Portugal)
233
+
language="ptPT"
234
+
download
235
+
;;
236
+
9) #Russian
237
+
language="ruRU"
238
+
download
239
+
;;
240
+
10) #Spanish
241
+
language="esLA"
242
+
download
243
+
;;
244
+
11) #Spanish (Spain)
245
+
language="esES"
246
+
download
247
+
;;
248
+
12) #Go back
249
+
OPTION2=""
250
+
tput reset
251
+
path
252
+
;;
253
+
13) #Exit
254
+
quit
255
+
;;
256
+
esac
257
+
}
258
+
259
+
functiondownload {
260
+
tput reset
261
+
tput setaf 2;echo"Alright, let's download your video now! youtube-dl is going to execute below. This may take some time."
262
+
tput setaf 5;echo"If you have not logged in, you might get an error about cookies file. Ignore it."
0 commit comments