From 0dafaaf15b0fc8eb12ea158828ca9000b6c8d856 Mon Sep 17 00:00:00 2001 From: fbt Date: Sat, 23 Nov 2019 07:18:51 +0300 Subject: [PATCH] The upload endpoint moved Signed-off-by: fbt --- ufw | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ufw b/ufw index ad5723d..9bfc9e2 100755 --- a/ufw +++ b/ufw @@ -148,26 +148,26 @@ upload() { -F submit="" \ "${misc_curl_args[@]}" \ -A 'zerofiles.org upload script' \ - "$cfg_service_url/$cfg_api_path/upload" ) + "$cfg_service_url/maw.json" ) if (( flag_shortlink )); then if (( flag_directlink )); then - file_url_request='short_url_direct' - else file_url_request='short_url' + else + file_url_request='page_short_url' fi else - if (( flag_directlink )); then - file_url_request='direct_url' - else - file_url_request='page_url' - fi + file_url_request='url' fi get_api_status <<< "$api_response" if (( api_status == 200 )); then - file_link=$( jshon -e data -e file -e "$file_url_request" -u <<< "$api_response" ) + file_link=$( jshon -e data -e "$file_url_request" -u <<< "$api_response" ) + + (( flag_shortlink )) || { + (( flag_directlink )) || file_link="${file_link#*.}" + } printf '%s\n' "$file_link"