Files
Catboxuploader/catboxuploader
2026-08-05 21:49:22 +00:00

50 lines
823 B
Bash

#!/bin/bash
filename="$1"
uploadtime() {
echo -e "\nbe in the directory of the file you want to upload\ninput how long you want the file to be uploaded for"
read -p "valid options (hours) 1, 12, 24, 72: " time
case "$time" in
1|12|24|72 )
time+="h"
;;
* ) echo "invalid upload time"
uploadtime
;;
esac
}
main(){
uploadtime
echo "uploading..."
curl -F "reqtype=fileupload" -F "time=$time" -F "fileToUpload=@$filename" https://litterbox.catbox.moe/resources/internals/api.php
}
[ -z "$1" ] && {
echo -e "no file provided\nusage is catboxuploader yourfilehere\nsuch as: catboxuploader 123.txt"
exit 1
}
[ "$#" -gt 1 ] && {
echo -e "error too many arguments\nonly 1 file may be uploaded at at time"
exit 1
}
[ ! -f "$1" ] && {
echo "file not found"
exit 1
}
main && echo "uploaded"