Skip to content

Commit 97374e6

Browse files
committed
Requests proxy support
1 parent 52b8192 commit 97374e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

overpass/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class API(object):
1616
_timeout = 25 # second
1717
_endpoint = "https://overpass-api.de/api/interpreter"
1818
_debug = False
19+
_proxies = None
1920

2021
_QUERY_TEMPLATE = "[out:{out}];{query}out {verbosity};"
2122
_GEOJSON_QUERY_TEMPLATE = "[out:json];{query}out {verbosity};"
@@ -24,6 +25,7 @@ def __init__(self, *args, **kwargs):
2425
self.endpoint = kwargs.get("endpoint", self._endpoint)
2526
self.timeout = kwargs.get("timeout", self._timeout)
2627
self.debug = kwargs.get("debug", self._debug)
28+
self.proxies = kwargs.get("proxies", self._proxies)
2729
self._status = None
2830

2931
if self.debug:
@@ -121,6 +123,7 @@ def _GetFromOverpass(self, query):
121123
self.endpoint,
122124
data=payload,
123125
timeout=self.timeout,
126+
proxies=self.proxies,
124127
headers={'Accept-Charset': 'utf-8;q=0.7,*;q=0.7'}
125128
)
126129

0 commit comments

Comments
 (0)