summarylogtreecommitdiffstats
path: root/pytrainer.sh
diff options
context:
space:
mode:
authorzoe2019-02-12 23:24:16 +0100
committerzoe2019-02-12 23:24:16 +0100
commit02c1ffa854eb3796efb5ae008f92c10b0049a1a3 (patch)
tree0fd70f7ad1e2a8c1da5416ac8ec71f6ef16b148e /pytrainer.sh
parent7cabf3ecf0f586e8026909ec4efa66a4abde5d1d (diff)
downloadaur-02c1ffa854eb3796efb5ae008f92c10b0049a1a3.tar.gz
Pached pytrainer.sh so that osm maps work again
Diffstat (limited to 'pytrainer.sh')
-rwxr-xr-xpytrainer.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/pytrainer.sh b/pytrainer.sh
index f0b9a2cbd3f5..32cd360d5f2f 100755
--- a/pytrainer.sh
+++ b/pytrainer.sh
@@ -1,5 +1,12 @@
#!/bin/sh
# First arg is log level, e.g. -d for DEBUG
+# As explained on : https://github.com/pytrainer/pytrainer/issues/158#issuecomment-448475330
+# The reason for the non working OSM in pytrainer is, that openlayers.org / cloudfare is sending:
+#`Access denied | openlayers.org used Cloudflare to restrict access`
+#when using the default user-agent of the python urllib. Changing user-agent to pytrainer solves it:
+wget -q -O ${HOME}/.pytrainer/tmp/cache/OpenLayers.js http://www.openlayers.org/api/OpenLayers.js
+
+
cd /usr/share/pytrainer
exec python2 pytrainer "$@"