Compare commits
2 commits
6b558086c1
...
fc34c2bdcf
Author | SHA1 | Date | |
---|---|---|---|
Edward Betts | fc34c2bdcf | ||
Edward Betts | b8b42b1440 |
|
@ -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)"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue