Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Commit 659b703

Browse files
committed
send user agent identifying the mvg bot and just accept json
1 parent ac7946c commit 659b703

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mvg_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
def _perform_api_request(url):
18-
resp = requests.get(url, headers={'X-MVG-Authorization-Key': api_key, 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Referer': 'https://www.mvg.de/dienste/abfahrtszeiten.html', 'Sec-Fetch-Mode': 'cors', 'X-Requested-With': 'XMLHttpRequest'})
18+
resp = requests.get(url, headers={'X-MVG-Authorization-Key': api_key, 'User-Agent': 'python-mvg-api/1 (+https://github.com/leftshift/python_mvg_api)', 'Accept': 'application/json'})
1919
return resp.json()
2020

2121

0 commit comments

Comments
 (0)