Open VaclavTrpisovsky opened 1 year ago
I made a fork of this repo that includes a --referer
option but it was a quick-and-dirty fix, please don't pull it. It seems to work, though. A guide for downloading from Mapy.cz is included there in the README.
When downloading from mapy.cz, any request will fail with
403: Forbidden
.My command (downloads hiking maps for most of the Czech Republic):
download-tiles cr.mbtiles --zoom-levels=6-15 --bbox="12.1398,48.6183,17.5231,50.9722" --attribution="" --tiles-url=https://mapserver.mapy.cz/turist-m/{z}-{x}-{y}
Turns out, Mapy.cz implemented protection against bulk downloads by only allowing requests with a specific referer. This can be circumvented by changing line 153 in
cli.py
fromtiles_headers={"User-Agent": user_agent},
totiles_headers={"Referer": "https://mapy.cz/"},
Could somebody implement a way to do this without modifying the source code? An option such as
--header={"Name:" "Value"}
would be appreciated. This is important because devs of their Android app keep killing support for older devices and their offline maps, requiring us to resort to measures like these. Anyway, I hope anyone seeking good offline hiking maps finds this useful. Cheers, VT