@@ -133,10 +133,6 @@ upload() {
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$album_name" ]]; then
|
|
||||||
get_album_id "$album_name"
|
|
||||||
fi
|
|
||||||
|
|
||||||
api_response=$( curl \
|
api_response=$( curl \
|
||||||
-F file="@$file" \
|
-F file="@$file" \
|
||||||
-F format='json' \
|
-F format='json' \
|
||||||
@@ -193,7 +189,7 @@ get_shortlink() {
|
|||||||
get_api_status <<< "$api_response"
|
get_api_status <<< "$api_response"
|
||||||
|
|
||||||
if (( api_status == 200 )); then
|
if (( api_status == 200 )); then
|
||||||
read -r short_url real_url < <(
|
read -r short_url < <(
|
||||||
jq -r '.data.short_url' <<< "$api_response"
|
jq -r '.data.short_url' <<< "$api_response"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -426,8 +422,6 @@ main() {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TEMPDIR="$cfg_tmp_dir"
|
|
||||||
|
|
||||||
case "${action:-upload}" in
|
case "${action:-upload}" in
|
||||||
upload)
|
upload)
|
||||||
[[ -d "$cfg_tmp_dir" ]] || {
|
[[ -d "$cfg_tmp_dir" ]] || {
|
||||||
@@ -438,6 +432,10 @@ main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ "$album_name" ]]; then
|
||||||
|
get_album_id "$album_name"
|
||||||
|
fi
|
||||||
|
|
||||||
get_token || return $?
|
get_token || return $?
|
||||||
(( ${#args[@]} )) || return 1
|
(( ${#args[@]} )) || return 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user