diff --git a/uploader.sh b/uploader.sh index a781938..244139e 100755 --- a/uploader.sh +++ b/uploader.sh @@ -57,12 +57,11 @@ HTTP_CODE=$(echo "$RESPONSE" | tail -n1) BODY=$(echo "$RESPONSE" | sed '$d') if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then - # Parse the URL from the JSON response. - # This assumes a response like {"url": "https://..."} - # You might need to adjust the regex or use jq depending on your API structure. - URL=$(echo "$BODY" | grep -oP '"url"\s*:\s*"\K[^"]+') + # Parse the direct file URL from the JSON response. + # Expects a response containing a "file_url" field. + URL=$(echo "$BODY" | grep -oP '"file_url"\s*:\s*"\K[^"]+') - # Fallback: if no URL field is found, just copy the whole body if it's a raw string + # Fallback: if no file_url field is found, just copy the whole body if it's a raw string if [ -z "$URL" ]; then URL="$BODY" fi