neue Nomenklatur
This commit is contained in:
parent
d43f48f6d9
commit
5ad75bf9fa
3 changed files with 39 additions and 2 deletions
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
function upload_to_vivo () {
|
||||
api_key=$1
|
||||
filepath=$2
|
||||
|
||||
filepath=$( readlink -f "$filepath" )
|
||||
# echo "filepath: $filepath" >&2
|
||||
|
||||
filesize=$(stat -c%s "$filepath")
|
||||
# echo "filesize: $filesize" >&2
|
||||
|
||||
upload_server=$(curl -s -X GET "https://vivo.sx/api/v1/upload/$filesize" -H "Content-Type: application/json" -H "X-AUTH: $api_key")
|
||||
upload_server=$(echo $upload_server | jq ".upload_url")
|
||||
upload_server=${upload_server//\"}
|
||||
# echo "Location: $upload_server" >&2
|
||||
|
||||
vivo_url=$(curl -X POST $upload_server -H "Content-Type: multipart/form-data" -H 'Cache-Control: no-cache' -F action=push -F session=$api_key -F "file=@\"$filepath\"")
|
||||
|
||||
echo "$vivo_url"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue