encode all the stuff
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
6e2c506e72
commit
823a2847c8
14
ufw
14
ufw
|
@ -84,7 +84,10 @@ get_max_filesize() {
|
||||||
get_album_id() {
|
get_album_id() {
|
||||||
declare api_response api_status api_status_message
|
declare api_response api_status api_status_message
|
||||||
|
|
||||||
api_response=$( curl -f "$cfg_service_url/albumctl.json?m=new&name=$1&secret=$secret" )
|
api_response=$( curl --get \
|
||||||
|
--data-urlencode "name=$1" \
|
||||||
|
--data-urlencode "secret=$secret" \
|
||||||
|
"$cfg_service_url/albumctl.json?m=new" )
|
||||||
|
|
||||||
get_api_status <<< "$api_response"
|
get_api_status <<< "$api_response"
|
||||||
|
|
||||||
|
@ -188,7 +191,10 @@ upload() {
|
||||||
get_shortlink() {
|
get_shortlink() {
|
||||||
declare url=$1 api_response api_status api_status_message
|
declare url=$1 api_response api_status api_status_message
|
||||||
|
|
||||||
api_response=$( curl "$cfg_service_url/shrink.json?url=${url}&secret=$secret" )
|
api_response=$( curl --data-urlencode "url=$url" \
|
||||||
|
--data-urlencode "secret=$secret" \
|
||||||
|
"$cfg_service_url/shrink.json" )
|
||||||
|
|
||||||
get_api_status <<< "$api_response"
|
get_api_status <<< "$api_response"
|
||||||
|
|
||||||
if (( api_status == 200 )); then
|
if (( api_status == 200 )); then
|
||||||
|
@ -416,6 +422,8 @@ main() {
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Args: ${args[@]}"
|
||||||
|
|
||||||
xclip_args+=( -selection "$xclip_selector" )
|
xclip_args+=( -selection "$xclip_selector" )
|
||||||
|
|
||||||
# Catch the args after --
|
# Catch the args after --
|
||||||
|
@ -444,7 +452,7 @@ main() {
|
||||||
get_token || return $?
|
get_token || return $?
|
||||||
|
|
||||||
for t in "${args[@]}"; do
|
for t in "${args[@]}"; do
|
||||||
get_shortlink "$1"
|
get_shortlink "$t"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user