diff --git a/matcher/__init__.py b/matcher/__init__.py index 80c2c41..e389a0a 100644 --- a/matcher/__init__.py +++ b/matcher/__init__.py @@ -1,12 +1,9 @@ """Match OSM and Wikidata items.""" - CallParams = dict[str, str | int] user_agent = ( - "osm-wikidata/0.2" - + " (https://github.com/EdwardBetts/osm-wikidata;" - + " edward@4angle.com)" + "osm-wikidata/0.2 (https://git.4angle.com/edward/owl-map; edward@4angle.com)" ) diff --git a/matcher/nominatim.py b/matcher/nominatim.py index c15b8fc..f065625 100644 --- a/matcher/nominatim.py +++ b/matcher/nominatim.py @@ -6,7 +6,7 @@ from collections import OrderedDict import requests -from . import CallParams +from . import CallParams, user_agent_headers Hit = dict[str, typing.Any] @@ -28,7 +28,7 @@ def lookup_with_params(**kwargs: str) -> list[Hit]: "polygon_text": 0, } params.update(kwargs) - r = requests.get(url, params=params) + r = requests.get(url, params=params, headers=user_agent_headers()) if r.status_code == 500: raise SearchError