remake the whole thing. still not finished
This commit is contained in:
parent
12741ce4ba
commit
78c532808e
8 changed files with 611 additions and 160 deletions
62
helpers/variables.sh
Normal file
62
helpers/variables.sh
Normal file
|
@ -0,0 +1,62 @@
|
|||
GREEN="\e[32m"
|
||||
YELLOW="\e[33m"
|
||||
RED="\e[31m"
|
||||
CYAN="\e[36m"
|
||||
BOLD="\e[1m"
|
||||
RESET="\e[0m"
|
||||
|
||||
CONFIG_DIR="$HOME/.config/grabIT"
|
||||
CONFIG_FILE="$CONFIG_DIR/config.json"
|
||||
NEEDS_SETUP=0
|
||||
|
||||
declare -A ALLOWED_KEYS=(
|
||||
["log_level"]="^(DEBUG|INFO|WARN|ERROR)$"
|
||||
["SHOW_CAPTURE_PREVIEW"]="^(true|false)$"
|
||||
["SHOW_NOTIFICATIONS"]="^(true|false)$"
|
||||
["SAVE_IMAGES"]="^(true|false)$"
|
||||
["SAVE_DIR"]="^.+$"
|
||||
["DOMAIN"]="^.+$"
|
||||
["DEFAULT_OPTION"]="^(upload|save|copy)$"
|
||||
["SERVICE"]="^(zipline|nest|fakecrime|ez|guns|pixelvault)$"
|
||||
)
|
||||
|
||||
REQUIRED_KEYS=(
|
||||
"SHOW_CAPTURE_PREVIEW"
|
||||
"SHOW_NOTIFICATIONS"
|
||||
"SAVE_IMAGES"
|
||||
"DEFAULT_OPTION"
|
||||
)
|
||||
|
||||
valid_services=("zipline" "nest" "fakecrime" "ez" "guns" "pixelvault")
|
||||
valid_args=("--help" "--version" "--config" "-c" "-u" "-f" "-d" "--silent")
|
||||
|
||||
for service in "${valid_services[@]}"; do
|
||||
valid_args+=("--$service")
|
||||
ALLOWED_KEYS["${service}_auth"]="^.+$"
|
||||
done
|
||||
|
||||
declare -A UPLOADERS=(
|
||||
["pixelvault"]="https://pixelvault.co"
|
||||
["guns"]="https://guns.lol/api/upload"
|
||||
["ez"]="https://api.e-z.host/files"
|
||||
["fakecrime"]="https://upload.fakecrime.bio"
|
||||
["nest"]="https://nest.rip/api/files/upload"
|
||||
)
|
||||
|
||||
declare -A UPLOAD_HEADERS=(
|
||||
["pixelvault"]="https://pixelvault.co|Authorization"
|
||||
["guns"]="key"
|
||||
["ez"]="key"
|
||||
["fakecrime"]="Authorization"
|
||||
["nest"]="Authorization"
|
||||
["zipline"]="authorization"
|
||||
)
|
||||
|
||||
declare -A UPLOAD_JSON_KEYS=(
|
||||
["pixelvault"]="resource"
|
||||
["nest"]="fileURL"
|
||||
["guns"]="link"
|
||||
["ez"]="imageUrl"
|
||||
["fakecrime"]="url"
|
||||
["zipline"]="files[0].url"
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue