This commit is contained in:
tidoni 2021-02-16 12:02:58 +01:00
commit 51d4de07d1
3 changed files with 54 additions and 0 deletions

22
voeUpload.fn Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
function upload_to_voe () {
api_key=$1
filepath=$2
filepath=$( readlink -f "$filepath" )
# echo "filepath: $filepath" >&2
upload_server=$(curl -s "https://voe.sx/api/upload/server?key=$api_key")
upload_server=$(echo $upload_server | jq ".result")
upload_server=${upload_server//\"}
# echo "Upload Target: $upload_server" >&2
voe_url=$(curl -X POST $upload_server -H "Content-Type: multipart/form-data" -H 'Cache-Control: no-cache' -F action=push -F api_key=$api_key -F "file=@\"$filepath\"")
voe_url=${voe_url#*<textarea name=\"fn\">}
voe_url=${voe_url%%</textarea>*}
voe_url="https://voe.sx/"${voe_url}
# echo "voe_url: $voe_url" >&2
echo "$voe_url"
}