dztui icon indicating copy to clipboard operation
dztui copied to clipboard

Failure to get location at startup

Open pspirichev opened this issue 1 year ago • 1 comments

At startup local_latlon() function freezes script at

local url="http://ip-api.com/json/$local_ip"
local res=$(curl -Ls "$url" | jq -r '"\(.lat)\n\(.lon)"')

Curl can't get requested result. Trying access http://ip-api.com/json/ via browser, returns error: message "SSL unavailable for this endpoint, order a key at https://members.ip-api.com/" I think, that now ip-api.com requires key, for getting info about IP

pspirichev avatar Aug 06 '24 12:08 pspirichev

Thanks for the report. Tested it over here and was unable to reproduce it. Accessing that endpoint in a browser will not function the same as when using curl due to parameters being sent differently:

  • Browser: fails
  • curl (terminal): succeeds

Are you sure the local IP was being resolved correctly before being interpolated into the URL? (Lines 476-480)

Can you send the full error message?

aclist avatar Aug 06 '24 22:08 aclist

Closed due to inactivity

aclist avatar Aug 23 '24 13:08 aclist