jason0x43 / alfred-weather

Get weather forecast using Alfred
MIT License
158 stars 20 forks source link

Strange error when using non-default location #38

Open gzheng92 opened 3 months ago

gzheng92 commented 3 months ago

When I try and get the weather for a specific location using something like wtd Beverly Hills, CA 90210, I get a Error 403.

I dug a little deeper and tried running the bash script directly, and got the following:

[weather] 2024/05/29 08:46:07 Locating Beverly Hills, CA
[weather] 2024/05/29 08:46:07 request query: addressDetails=1&format=json&q=Beverly+Hills%2C+CA
[weather] 2024/05/29 08:46:07 Error getting data: <html>
<head>
<title>Access blocked</title>
</head>
<body>
<h1>Access blocked</h1>

<p>You have been blocked because you have violated the
<a href="https://operations.osmfoundation.org/policies/nominatim/">usage policy</a>
of OSM's Nominatim geocoding service. Please be aware that OSM's resources are
limited and shared between many users. The usage policy is there to ensure that
the service remains usable for everybody.</p>

<p>Please review the terms and make sure that your
software adheres to the terms. You should in particular verify that you have set a
<b>custom HTTP referrer or HTTP user agent</b> that identifies your application, and
that you are not overusing the service with massive bulk requests.</p>

<p>If you feel that this block is unjustified or remains after you have adopted
your usage, you may contact the Nominatim system administrator at
nominatim@openstreetmap.org to have this block lifted.</p>
</body>
</head>
{"items":[{"title":"Error: 403 Forbidden","arg":"{}","valid":false}]}

This is not an issue with my specific API key --- for one, I use OpenWeather, not OpenStreetMaps. I at first thought the two were related, but I emailed and confirmed this was not the case. Incidentally, the OpenWeather geocoding service works just fine for me, which is further evidence that this is not an issue with my personal API key.

gzheng92 commented 3 months ago

I confirmed that, if I change the config file to a new lat/lon, the data displays just fine.

Incidentally, the config file is not located where the script says (under Alfred 5/...) but rather under Alfred/...

lylehust commented 2 months ago

Also couldn't change the default location. Input any ZIP code, will get the same error message, "Error: 403 forbidden". The detailed information as gzheng92 shown.

Please fix the issue.

Thank you.