Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't attempt to download further tiles if google blocked you #42

Closed
flixr opened this issue Jan 26, 2011 · 10 comments · Fixed by #276
Closed

don't attempt to download further tiles if google blocked you #42

flixr opened this issue Jan 26, 2011 · 10 comments · Fixed by #276
Labels
Milestone

Comments

@flixr
Copy link
Member

flixr commented Jan 26, 2011

When trying to download map tiles and you get a ERROR 403: Forbidden. it should abort trying to download the rest as well. Since then you are temporarily blocked by Google and there is no point in trying to download the rest. Also print a more descriptive error message saying that you are probably temporarily blocked by google

see sw/lib/ocaml/gm.ml

@flixr
Copy link
Member Author

flixr commented Nov 3, 2011

It seems there is no really easy way to do this when using wget (as we do in sw/lib/ocaml/http.ml)
You can't distinguish which http error you got from the wget exit code, so we would have to look through the Failure string to check if the tile was not found (404) and we want to try a lower resolution tile or if we were blocked (403) and can stop trying for now....

@OpenUAS
Copy link
Contributor

OpenUAS commented Aug 9, 2012

maybe add --server-response as in example wget --server-response http://localhost/nx.file 2>&1 | awk '/^ HTTP/{print $2}'
but then not awk but ocaml ofcouse. maybe wget returncode: 8 "Server issued an error response" will help.

Or else maybe a real a http lib from ocaml e.g. http://ocaml-http.forge.ocamlcore.org/examples/basic_auth.ml.

@flixr
Copy link
Member Author

flixr commented Sep 9, 2012

@gautierhattenberger I tried to quickly fix this by using the Http_client from ocamlnet
See my branch try_ocaml_netclient, or directly commit flixr/paparazzi@b127a4d
I didn't really get it working this evening, but you get the idea.... don't really have more time to spend on this right now.

@gautierhattenberger
Copy link
Member

@flixr I compiled your code this morning and it seems to work like a charm. I tried to reach the download limit by getting a lot of tiles from GM, but couldn't in the end... (the limit seems higher than what I thought, or did they increased it recently ? )

@flixr
Copy link
Member Author

flixr commented Sep 12, 2012

Two reasons it didn't seem to work properly for me:

  1. I screwed up the maps makefile (is now fixed again) and was wondering why I got huge tiles.
  2. Forgot to delete erroneous files.

This is fixed in the pull request. Would be good if you could have a look at it though...

I also just tried to reach the limit again, was unable to reach it... so this is untested.
Will have to try at work again, there I was able to reach the limit a few days ago.

@flixr
Copy link
Member Author

flixr commented Sep 12, 2012

Regarding the google maps limit resulting in a 403:
I could quickly get into the limit again by using the old code and downloading a few tiles, switching to the new netclient implementation I could then continue to get tiles. So my guess is that this has something to do with the different user_agent of wget/netclient...

@flixr
Copy link
Member Author

flixr commented Sep 14, 2012

partially fixed with #276

@esden
Copy link
Member

esden commented Sep 21, 2012

+1 and also, maybe there is a way of downloading the tiles without risking to be blocked by google?

@flixr
Copy link
Member Author

flixr commented Sep 21, 2012

short answer: no
But as mentioned above, with the ocaml netclient already merged into current master with 276) I wasn't able to run into the limit anymore, just switching back to old code, I was already in the limit, back to new code: was able to continue downloading tiles for like 20min

@flixr
Copy link
Member Author

flixr commented Feb 8, 2013

closing, as it doesn't seem to occur anymore with the new code....

@flixr flixr closed this as completed Feb 8, 2013
kirkscheper pushed a commit to kirkscheper/paparazzi that referenced this issue Sep 19, 2017
* ARTag markers

* Add new message REMOTE_GPS_LOCAL and way to parse it

Made for indoor navigation in wide space

* [pprzlink] Added REMOTE_GPS_LOCAL message

* New airframe + small fixes

* Slamdunk GPS and avoidance

Real full commit

* Repush of each actual changes

Fighting with Git isn't an easy thing

* Undoing TUDelft merge

* [Slamdunk] Last updates
kirkscheper pushed a commit to kirkscheper/paparazzi that referenced this issue Sep 21, 2017
* ARTag markers

* Add new message REMOTE_GPS_LOCAL and way to parse it

Made for indoor navigation in wide space

* [pprzlink] Added REMOTE_GPS_LOCAL message

* New airframe + small fixes

* Slamdunk GPS and avoidance

Real full commit

* Repush of each actual changes

Fighting with Git isn't an easy thing

* Undoing TUDelft merge

* [Slamdunk] Last updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants