pgoapi icon indicating copy to clipboard operation
pgoapi copied to clipboard

get_map_objects?

Open jangeja opened this issue 9 years ago • 34 comments

I just ran the spiral search demo and I didn't find any pokemon or pokestops and I know there were some in the area. I'm only seeing these two fields in the JSON response.

'current_timestamp_ms': 1470569750623, 's2_cell_id': 9290065149094264832

jangeja avatar Aug 07 '16 11:08 jangeja

The same here...any solution?

mviniciusleal avatar Aug 07 '16 14:08 mviniciusleal

Having the same problem as well. All I want is the location of gyms and pokestops.

crispmark avatar Aug 07 '16 15:08 crispmark

The default radius was the issue in my code, i used radius = 5 in get_cell_ids before instead of the default radius = 10 to get smaller group of pokestops. Unsure what was the old parameter unit but now it seems to be expressed in meters and values 300 - 1000 are getting the similar amount of pokestops as 5-10 before.

Commit hash: 35221ff5daf21f9c568c0f6b59d237ca6caeb30c

EDIT: I meant the one in utilities.py, spiral_poi_search.py uses its own method. Maybe it's better to reattach it to utilities.py

Vigerus avatar Aug 07 '16 15:08 Vigerus

the unkown6 fix has not been merged yet, see the pull requests

ProLoDs avatar Aug 07 '16 17:08 ProLoDs

Anyone figure this out? Modified spiral_poi_search.py so that it uses the utilities.py get_cell_ids, but im still running into the same issue

jangeja avatar Aug 07 '16 17:08 jangeja

@ProLoDs It might be just me, but even if I merge these files, the cells are still empty :( Can anyone shine a light here ?

dnsBlah avatar Aug 07 '16 17:08 dnsBlah

I've been banging my head on a wall with this problem. Am I missing something?

jangeja avatar Aug 07 '16 17:08 jangeja

https://github.com/weissi1994/PokemonGo-Map see this

ProLoDs avatar Aug 07 '16 17:08 ProLoDs

I'd like to use the pgoapi to build my own application. I will be doing a little more than just a pokemonGo Map. Why am I only getting empty cells?

jangeja avatar Aug 07 '16 17:08 jangeja

@ProLoDs indeed the ahaaaaa map is working again :) thats a great relief, but my debug engineering aint that level yet to see what I need to change exactly.

Just receiving empty cells, thought mayba a ban, but thats not the case, just guessing that somehow we need to implement the u6 proto together with all the requests i.e. get_mapobjects But thats already in the requests proto (i think) combining the get_mapobjects in the original call, and even after 10 seconds or whatever does not give any results on mapobjects

dnsBlah avatar Aug 07 '16 18:08 dnsBlah

@dnsBlah

  1. Download http://pastebin.com/raw/fCSw0Fz4 as encrypt.c
  2. Compile to .so (gcc -shared -o encrypt.so -fPIC encrypt.c)
  3. Edit ~/pgoapi-master/pgoapi/pygoapi.py insert this line in the init method of PGoApi: self.__signature_lib = "encrypt.so"
  4. Copy encrypt.so into same directory as the python program you are running OR include it in path
  5. DONE!!! IT WORKS!

jangeja avatar Aug 07 '16 18:08 jangeja

@jmangeja1 Been there, done that, still no results :( o wait, step 4... ? moment :)

dnsBlah avatar Aug 07 '16 18:08 dnsBlah

@dnsBlah self.__signature_lib = "encrypt.so" Is the most important step.

if you don't do step 4, you will get an error saying it cant find encrypt.so so thats easy to track down However it took a while to figure out setting the signature lib

jangeja avatar Aug 07 '16 18:08 jangeja

@dnsBlah Also I forgot to mention....

These should be run after 4 in my previous comment 5. uninstall pygoapi (pip uninstall pygoapi) 6. reinstall python setup.py install

jangeja avatar Aug 07 '16 18:08 jangeja

Actually I used the dll file

life saver!

dnsBlah avatar Aug 07 '16 18:08 dnsBlah

@jmangeja1 thanks a lot! On my debian however putting encrypt.so into a directory in $PATH did not work, i had to use an absolute path instead.

Trolldemorted avatar Aug 09 '16 00:08 Trolldemorted

I am using https://github.com/keyphact repository as of evening of August 10th with encrypt.dll compiled on a mac and am not getting any objects returned in GET_MAP_OBJECTS calls. What is the fix?

BigChase avatar Aug 11 '16 00:08 BigChase

@BigChase if youre using a Mac, you need encrypt.so and you need to compile it yourself. Follow my instructions posted earlier

jangeja avatar Aug 11 '16 00:08 jangeja

@jmangeja1 I've done so.  Compiled both into encrypt.dll in /usr/local/lib and as encrypt.so in same directory as pgoapi.py.

How can I debut encrypt.dll in order to determine if it's functioning correctly? (There were a large number of warnings during compilation to encrypt.so, but just repeats of "warning: '&' within '|' [-Wbitwise-op-parentheses]".)

(On a Mac.)

BigChase avatar Aug 11 '16 01:08 BigChase

warnings are fine. Did you change the line about signature lib in pgoapi.py?

jangeja avatar Aug 11 '16 01:08 jangeja

Yes, changed that line though I am using keyphact's repository which was updated yesterday and again today which I believe deals with signature issues in slightly different way. With the folllowing line in pokecli.py:

api.activate_signature("/usr/local/lib/encrypt.dll")

plus i added encrypt.dll to global path.

BigChase avatar Aug 11 '16 01:08 BigChase

try app.activate_signature("encrypt.so") and put encrypt.so in the same directory as pokecli.py

jangeja avatar Aug 11 '16 01:08 jangeja

Great idea! And guess what? Worked like a charm! Love you man. Was working on this non-stop for 24 hours straight trying every combination of repository, user account, etc.

Until I followed your advice, I was using the compilation instructions and file placement on the following URL: https://github.com/tejado/pgoapi/issues/181#issuecomment-238058983. Wonder why it didn't work and your approach did?

The next issue I am having is that I have to run pokecli.py twice everytime. The first time always yields: "pgoapi.exceptions.ServerSideRequestThrottlingException: Request throttled by server... slow down man". And then immediately rerunning script works to completion. Any ideas?

Thanks again. Huge help!

BigChase avatar Aug 11 '16 02:08 BigChase

Yea, You need to put time.sleep(x) delays after get_map_objects i recommend 10 seconds

jangeja avatar Aug 11 '16 02:08 jangeja

There is only one get_map_objects in pokecli.py, yet I still experience the described "slow doan man" failure on the first script execution. Can't figure out why?

BigChase avatar Aug 11 '16 02:08 BigChase

put a time.sleep(1) after any api call made in pokecli.py

jangeja avatar Aug 11 '16 03:08 jangeja

Thanks again. Now to start understanding the get_map_objects responses.... (size of a cell, how to reference the spawn times and exact locations of nearby pokemon, etc.)...

BigChase avatar Aug 11 '16 03:08 BigChase

@dnsBlah
can you share your .dll? I have no idea how to build it on windows, thanks~

EasonPai avatar Aug 11 '16 09:08 EasonPai

I'm using a Unix machine, sorry. My dll would be useless. Try this one instead: #181 it's in a comment of Scotty

dnsBlah avatar Aug 11 '16 14:08 dnsBlah

@dnsblah how are you using a proxy? When I use a proxy it doesn't return and forts or Pokemon

jangeja avatar Aug 11 '16 14:08 jangeja