-
Notifications
You must be signed in to change notification settings - Fork 0
/
asciimaker.sh
executable file
·570 lines (527 loc) · 19 KB
/
asciimaker.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
#Ale Cominotti - 2020
echo -ne "\033[00;33mLoading...\r"
#Char colors
NONE='\033[00m'
RED='\033[00;31m'
GREEN='\033[01;32m'
GREENTHIN='\033[00;32m'
YELLOW='\033[00;33m'
YELLOWBG='\033[07;33m'
PURPLE='\033[00;35m'
CYAN='\033[00;36m'
WHITE='\033[01;37m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
resources_folder="resources"
sequence_folder="${resources_folder}/sequences"
prompting_clean=0
function help {
clear
banner
while read line; do
echo $line
done < $resources_folder/help.txt
clean_temps
exit 1
}
function help_message {
echo -e "Use ${GREENTHIN}-h${NONE} or ${GREENTHIN}--help${NONE} to show help"
}
function banner {
delay=0.045
echo -ne "${YELLOW}"
#echo '
# ______ ______ ______ __ __ __ __ ______ __ __ ______ ______
#/\ __ \ /\ ___\ /\ ___\ /\ \ /\ \ /\ "-./ \ /\ __ \ /\ \/ / /\ ___\ /\ == \
#\ \ __ \\ \___ \\ \ \____\ \ \\ \ \ \ \ \-./\ \\ \ __ \\ \ _"-.\ \ __\ \ \ __<
# \ \_\ \_\\/\_____\\ \_____\\ \_\\ \_\ \ \_\ \ \_\\ \_\ \_\\ \_\ \_\\ \_____\\ \_\ \_\
# \/_/\/_/ \/_____/ \/_____/ \/_/ \/_/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/
echo ' ______ ______ ______ __ __ __ __ ______ __ __ ______ ______ '
sleep $delay
echo '/\ __ \ /\ ___\ /\ ___\ /\ \ /\ \ /\ "-./ \ /\ __ \ /\ \/ / /\ ___\ /\ == \ '
sleep $delay
echo '\ \ __ \\ \___ \\ \ \____\ \ \\ \ \ \ \ \-./\ \\ \ __ \\ \ _"-.\ \ __\ \ \ __< '
sleep $delay
echo ' \ \_\ \_\\/\_____\\ \_____\\ \_\\ \_\ \ \_\ \ \_\\ \_\ \_\\ \_\ \_\\ \_____\\ \_\ \_\ '
sleep $delay
echo ' \/_/\/_/ \/_____/ \/_____/ \/_/ \/_/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/ '
sleep $delay
echo''
sleep $delay
echo -e "${NONE}"
}
stty -echoctl # hide ^C
function clean_temps {
`rm -f $resources_folder/outputascii.html`
`rm -f $resources_folder/*.mp4`
`rm -f $resources_folder/*.part`
`rm -f $sequence_folder/*.jpg`
`rm -f $sequence_folder/*.txt`
`rm -f $resources_folder/running`
}
function clean_temps_verbose {
echo -ne "${CYAN}Cleaning temporary files..."
clean_temps
echo -ne "${BOLD}${GREEN}√ "
echo -e "Done${NONE}"
}
process_stop() {
echo -e "\n${RED}Process stopped.${NONE}"
if [ $prompting_clean -eq 0 ]; then
clean_temps_verbose
fi
exit 1
}
trap 'process_stop' SIGINT
#Dependecies check-----------------------------------------------------
#1 = installed | 0 = not installed
case "${OSTYPE}" in
linux-gnu)
jp2a_installed=$(dpkg-query -W -f='${Status}' jp2a 2>/dev/null | grep -c "ok installed")
ffmpeg_installed=$(dpkg-query -W -f='${Status}' ffmpeg 2>/dev/null | grep -c "ok installed")
if [[ $jp2a_installed -eq 0 ]] || [[ $ffmpeg_installed -eq 0 ]] && [[ ! "$*" == "-h" ]] && [[ ! "$*" == "--help" ]]; then
if [[ $jp2a_installed -eq 0 ]] ; then
echo -e "${YELLOWBG}'jpa2' is not installed and ASCII Maker needs it.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 && clean_temps
sudo apt-get install -y jp2a
fi
if [[ $ffmpeg_installed -eq 0 ]] ; then
echo -e "${YELLOWBG}'FFmpeg' is not installed and ASCII Maker needs it.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
sudo apt-get install -y ffmpeg
fi
echo -e "${GREEN}---------------------------------------------------------------------"
read -n 1 -s -r -p "Dependencies were installed! Press any key to continue to ASCII Maker"
echo -e "${NONE}"
fi
;;
darwin*)
brew_installed=`which brew`
jp2a_installed=`which jp2a`
ffmpeg_installed=`which ffmpeg`
if [ -z "$brew_installed" ] || [ -z "$jp2a_installed" ] || [ -z "$ffmpeg_installed" ] && [[ ! "$*" == "-h" ]] && [[ ! "$*" == "--help" ]]; then
if [ -z "$brew_installed" ]; then
echo -e "${YELLOWBG}'Homebrew' is not installed and ASCII Maker needs it to download the other dependencies.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 && clean_temps
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
if [ -z "$jp2a_installed" ]; then
echo -e "${YELLOWBG}'jpa2' is not installed and ASCII Maker needs it.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 && clean_temps
brew install jp2a
fi
if [ -z "$ffmpeg_installed" ]; then
echo -e "${YELLOWBG}'FFmpeg' is not installed and ASCII Maker needs it.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
brew install ffmpeg
fi
echo -e "${GREEN}---------------------------------------------------------------------"
read -n 1 -s -r -p "Dependencies were installed! Press any key to continue to ASCII Maker"
echo -e "${NONE}"
fi
;;
*)
echo -e "${RED}ERROR:${NONE} ASCII Maker is only compatible with Linux and Mac."
exit 1
;;
esac
#End dependecies check-------------------------------------------------
#Variables, do not modify
#----------------------------------------------------------
input=""
youtube_url=""
yt_name=""
fps=""
start_pos=""
end_pos=""
width=220 #width of final ASCII animation, default= 220
background="dark" #dark | light
chars="" #chars of ASCII animation, leave EMPTY for default
re='^[0-9]+([.][0-9]+)?$' #decimal number regex
time_regex='^([0-5][0-9]:)?[0-5][0-9]:[0-5][0-9]$'
#----------------------------------------------------------
youtube_dependencies_check(){
#installs python3, pip3, youtube-dl package and updates pip, setuptools and wheel
python3_installed=`command -v python3 >/dev/null 2>&1 && echo 1`
pip_installed=`which pip3`
if [[ ! $python3_installed -eq 1 ]] ; then
echo -e "${YELLOWBG}'Python 3' is not installed and ASCII Maker needs it to download Youtube videos.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 && clean_temps
if [[ "${OSTYPE}" == darwin* ]]; then
brew install python
else
sudo apt-get install python3
fi
python3 -m pip install --upgrade pip setuptools wheel #check pip, setuptools, and wheel are up to date
fi
if [ -z "$pip_installed" ] ; then
echo -e "${YELLOWBG}'Pip' is not installed and ASCII Maker needs it to download a Python Youtube package.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 && clean_temps
if [[ "${OSTYPE}" == darwin* ]]; then
brew install python3-pip
else
sudo apt-get install python3-pip
fi
fi
if ! python3 -m pip freeze | grep "youtube-dl"= > /dev/null ; then
echo -e "${YELLOWBG}'youtube-dl' is not installed and ASCII Maker needs it to download Youtube videos.${NONE}"
read -p "Would you like to install it? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
sudo python3 -m pip install youtube-dl
echo -e "${GREEN}---------------------------------------------------------------------"
read -n 1 -s -r -p "Youtube dependencies were installed! Press any key to continue to ASCII Maker"
echo -e "${NONE}"
fi
}
#Parameter handling----------------------------------------------------------
PARAMS=""
while (( "$#" )); do
case "$1" in
-i|--input)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
if [ ! -f $2 ]; then
clean_temps
echo -e "${RED}ERROR:${NONE} Input file '${2}' not found (ex.: './asciimaker -i video.mp4')" >&2
help_message
exit 1
fi
input=$2
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing input value (ex.: './asciimaker -i video.mp4)" >&2
help_message
exit 1
fi
;;
-h|--help)
help
exit 0
shift 2
;;
-f|--fps)
if [ -n "$2" ]; then
if ! [[ $2 =~ $re ]] && [[ ! -z $2 ]]
then
clean_temps
echo -e "${RED}ERROR:${NONE} FPS parameter must be a number (ex.: './asciimaker -i video.mp4 -fps 29.97')" >&2
help_message
exit 1
fi
fps=$2
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing FPS value (ex.: './asciimaker -i video.mp4 -fps 60')" >&2
help_message
exit 1
fi
;;
-w|--width)
if [ -n "$2" ]; then
width=$2
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing width value (ex.: './asciimaker -i video.mp4 -w 200')" >&2
help_message
exit 1
fi
;;
-c|--chars)
if [ -n "$2" ]; then
chars=$2
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing chars value (ex.: './asciimaker -i video.mp4 -c \".-01abc\" ')" >&2
help_message
exit 1
fi
;;
-b|--background)
if [ -n "$2" ]; then
if ! [[ $2 == "dark" ]] && [[ ! $2 == "light" ]]
then
clean_temps
echo -e "${RED}ERROR:${NONE} Incorrect background parameter (ex.: './asciimaker -i video.mp4 -b \"dark\" ')" >&2
help_message
exit 1
fi
background=$2
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing background value (ex.: './asciimaker -i video.mp4 -b \"dark\" ')" >&2
help_message
exit 1
fi
;;
-s|--start)
if [ -n "$2" ]; then
if ! [[ $2 =~ $time_regex ]] && [[ ! -z $2 ]]
then
clean_temps
echo -e "${RED}ERROR:${NONE} Incorrect time expression (ex.: './asciimaker -i video.mp4 -s 00:15 ')" >&2
help_message
exit 1
fi
start_pos=$2
if [[ ${#2} -eq 5 ]]; then
start_pos=`echo 00:$start_pos`
fi
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing starting position (ex.: './asciimaker -i video.mp4 -s 00:15 ')" >&2
help_message
exit 1
fi
;;
-e|--end)
if [ -n "$2" ]; then
if ! [[ $2 =~ $time_regex ]] && [[ ! -z $2 ]]
then
clean_temps
echo -e "${RED}ERROR:${NONE} Incorrect time expression (ex.: './asciimaker -i video.mp4 -e 00:45 ')" >&2
help_message
exit 1
fi
end_pos=$2
if [[ ${#2} -eq 5 ]]; then
end_pos=`echo 00:$end_pos`
fi
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing ending position (ex.: './asciimaker -i video.mp4 -e 00:45 ')" >&2
help_message
exit 1
fi
;;
-C|--clean)
if [ -f $resources_folder/running ]; then
prompting_clean=1
echo -e "${YELLOW}WARNING:${NONE} It seems like Ascii Maker is already running in another window.\nIf you clean all temporary files now, the currently running Ascii Maker will fail or generate a broken output.\nIf Ascii Maker is not currently running, proceed to solve any problems."
read -p "Would you like to continue? (y/n): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
fi
clean_temps_verbose
exit 0
;;
-y|--youtube)
if ! [ -z $input ]; then
clean_temps
echo -e "${RED}ERROR:${NONE} You can't use both local and Youtube inputs at the same time" >&2
help_message
exit 1
fi
youtube_dependencies_check
if [ -n "$2" ]; then
youtube_url="${2}"
shift 2
else
clean_temps
echo -e "${RED}ERROR:${NONE} Missing youtube URL (ex.: './asciimaker -y https://www.youtube.com/watch?v=dQw4w9WgXcQ')" >&2
help_message
exit 1
fi
;;
-*|--*=) # unsupported flags
clean_temps
echo -e "${RED}ERROR:${NONE} Unsupported argument: '$1'" >&2
help_message
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done
SECONDS=0 #timer start
if [ -f $resources_folder/running ] && [[ ! "$*" == "-h" ]] && [[ ! "$*" == "--help" ]] && [[ ! "$*" == "-C" ]] && [[ ! "$*" == "--clean" ]]; then
echo -e "${RED}ERROR:${NONE} ASCII Maker already running in another window" >&2
help_message
exit 1
else
`touch $resources_folder/running`
fi
#Youtube video download
if [[ ! $youtube_url == "" ]]; then
`rm -f $resources_folder/*.mp4`
clear
banner
echo -e "${GREENTHIN}Downloading video from Youtube, please wait...${NONE}"
video_dl=$(youtube-dl -o "resources/%(title)s" -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' ${youtube_url})
one=${video_dl#*Merging formats into }
two=${one%Deleting*}
input=`echo "$two" | awk -F'"' '{print $2}'`
yt_name=`echo ${input##*/}`
if [ -z "$yt_name" ]; then
exit 1
fi
fi
#Mandatory input -i check:
if [[ $input = "" ]]; then
clean_temps
echo -e "${RED}ERROR:${NONE} Missing input value! (ex.: './asciimaker -i video.mp4')" >&2
help_message
exit 1
fi
#Start and ending positions check:
if [ ! -z $start_pos ] && [ ! -z $end_pos ]; then
IFS=: read ah am as <<< "$start_pos"
IFS=: read bh bm bs <<< "$end_pos"
secondsA=$((10#$ah*60*60 + 10#$am*60 + 10#$as))
secondsB=$((10#$bh*60*60 + 10#$bm*60 + 10#$bs))
DIFF_SEC=$((secondsB - secondsA))
SEC=$(($DIFF_SEC%60))
MIN=$((($DIFF_SEC-$SEC)%3600/60))
HRS=$((($DIFF_SEC-$MIN*60)/3600))
TIME_DIFF="$HRS:$MIN:$SEC";
if [[ ! $TIME_DIFF != *"-"* ]];then
clean_temps
echo -e "${RED}ERROR:${NONE} Ending time position must be subsequent to the starting time position (ex.: './asciimaker -i video.mp4 -s 00:10 -e 00:15')" >&2
help_message
exit 1
fi
fi
if [ ! -z $end_pos ]; then
video_length=`ffprobe -i "$input" -show_entries format=duration -v quiet -of csv="p=0" | cut -d "." -f 1`
diff="$(($secondsB - $video_length))"
if (( $diff > 0 )); then
clean_temps
echo -e "${RED}ERROR:${NONE} Range of time selected not valid for that video (Maybe your ending time position exceeds video duration)." >&2
help_message
exit 1
fi
fi
#End parameter handling------------------------------------------------------
#Aca empieza la joda
clear
banner
if [[ "$yt_name" == "" ]]
then
echo -e "${BOLD}Input:${NONE} '${CYAN}${input}${NONE}'" #####
else
echo -e "${BOLD}Input:${NONE} '${CYAN}${yt_name}${NONE}' ${CYAN}(From Youtube)${NONE}" #####
fi
if [ -z $start_pos ]
then
echo -e "${BOLD}Start position:${NONE} ${CYAN}Same as input${NONE}" #####
else
echo -e "${BOLD}Start position:${NONE} ${CYAN}${start_pos}${NONE}" #####
fi
if [ -z $end_pos ]
then
echo -e "${BOLD}End position:${NONE} ${CYAN}Same as input${NONE}" #####
else
echo -e "${BOLD}End position:${NONE} ${CYAN}${end_pos}${NONE}" #####
fi
if [ -z $fps ]
then
echo -e "${BOLD}FPS:${NONE} ${CYAN}Same as input${NONE}" #####
else
echo -e "${BOLD}FPS:${NONE} ${CYAN}${fps}${NONE}" #####
fi
echo -e "${BOLD}Width:${NONE} ${CYAN}${width}${NONE}" #####
if [ -z $chars ]
then
echo -e "${BOLD}Chars:${NONE} ${CYAN}Default${NONE}" #####
else
echo -e "${BOLD}Chars:${NONE} '${CYAN}${chars}${NONE}'" #####
fi
echo -e "${BOLD}Background:${NONE} ${CYAN}${background}${NONE}" #####
echo -e "${PURPLE}-----------------------${NONE}" #####
#echo -e "${PURPLE}Press Ctrl+C to stop execution${NONE}" #####
echo -ne "Generating JPG sequence..." #####
#Spaghet-ish
if [ ! -z $start_pos ]
then
if [ ! -z $end_pos ]
then
ffmpeg -ss "${start_pos}" -to "${end_pos}" -i "${input}" -vf fps=$fps "${sequence_folder}/secuen%05d.jpg" -y -loglevel panic
else
ffmpeg -ss "${start_pos}" -i "${input}" -vf fps=$fps "${sequence_folder}/secuen%05d.jpg" -y -loglevel panic
fi
else
if [ ! -z $end_pos ]
then
ffmpeg -to "${end_pos}" -i "${input}" -vf fps=$fps "${sequence_folder}/secuen%05d.jpg" -y -loglevel panic
else
ffmpeg -i "${input}" -vf fps=$fps "${sequence_folder}/secuen%05d.jpg" -y -loglevel panic
fi
fi
echo -e "${BOLD}${GREEN}√${NONE}"
echo -ne "Generating ASCII frames..." #####
`rm -f output.html`
`rm -f $resources_folder/outputascii.html`
if [ -z $chars ]
then
`find $sequence_folder -name '*.jpg' | sort | xargs -I xxx jp2a --width=$width --background=$background xxx --output=xxx.txt`
else
`find $sequence_folder -name '*.jpg' | sort | xargs -I xxx jp2a --chars=${chars@Q} --width=$width --background=$background xxx --output=xxx.txt`
fi
echo -e "${BOLD}${GREEN}√${NONE}"
echo -ne "Generating HTML file..." #####
`for f in $sequence_folder/*.txt; do echo '</pre><pre>'; cat "$f"; done >> $resources_folder/outputascii.html`
echo -e "${BOLD}${GREEN}√${NONE}"
echo -ne "Cleaning temp files..." #####
`rm -f $resources_folder/*.mp4`
`rm -f $sequence_folder/*.jpg`
`rm -f $sequence_folder/*.txt`
tail -n +2 $resources_folder/outputascii.html > "FILE.tmp" && mv "FILE.tmp" $resources_folder/outputascii.html
`head --lines=-1 $resources_folder/outputascii.html > output.html`
`rm -f $resources_folder/outputascii.html`
`rm -f $resources_folder/*.part`
`echo "<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>ASCII HTML Art</title>
</head>
<body>
<style>
html {
background-color: black;
color: white;
}
</style>
<div id='images'>
<pre>" | cat - output.html > temp && mv temp output.html`
`echo '</pre>
</div>
<script type="text/javascript">
(function() {
var pres = document.querySelectorAll("#images pre");
var len = pres.length;
for(var i = 0; i < pres.length; i = i + 1) {
pres[i].style.display = "none";
}
var a = 0;
window.setInterval(function() {
pres[a].style.display = "none";
pres[(a + 1)%len].style.display = "block";
a = (a + 1) % len;
console.log(a)
}, 40);
}());
</script>
</body>
</html>' >> output.html`
echo -e "${BOLD}${GREEN}√${NONE}"
if (( $SECONDS > 3600 )) ; then
let "hours=SECONDS/3600"
let "minutes=(SECONDS%3600)/60"
let "seconds=(SECONDS%3600)%60"
echo "Completed in $hours hour(s), $minutes minute(s) and $seconds second(s)"
elif (( $SECONDS > 60 )) ; then
let "minutes=(SECONDS%3600)/60"
let "seconds=(SECONDS%3600)%60"
echo -ne "Completed in $minutes minute(s) and $seconds second(s)"
else
echo -ne "Completed in $SECONDS seconds"
fi
echo -e "${BOLD}${GREEN} √${NONE}"
echo -e "ASCII HTML Animation saved in '${BOLD}${GREEN}output.html${NONE}'"
`rm -f $resources_folder/running`
exit 0