Update plugin.py

Apparently the Nomatim API changed(?).

The new search format was tested on my bot and all seems to work.
This commit is contained in:
PeGaSuS 2023-08-01 21:52:38 +02:00 committed by GitHub
parent 100120f76c
commit 1dadb7a9e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,7 @@ class NuWeather(callbacks.Plugin):
def _nominatim_geocode(self, location): def _nominatim_geocode(self, location):
location = location.lower() location = location.lower()
url = 'https://nominatim.openstreetmap.org/search/%s?format=jsonv2' % utils.web.urlquote(location) url = 'https://nominatim.openstreetmap.org/search?q=%s&format=jsonv2' % utils.web.urlquote(location)
self.log.debug('NuWeather: using url %s (geocoding)', url) self.log.debug('NuWeather: using url %s (geocoding)', url)
# Custom User agent & caching are required for Nominatim per https://operations.osmfoundation.org/policies/nominatim/ # Custom User agent & caching are required for Nominatim per https://operations.osmfoundation.org/policies/nominatim/
data = self._fetch_json(url) data = self._fetch_json(url)