rubenvereecken / pokemongo-api

Pokemon Go API for Python
Other
359 stars 120 forks source link

Exception raised: 'MapPokemon' object has no attribute 'pokemon_data' #62

Open envi253 opened 8 years ago

envi253 commented 8 years ago

Whenever the Bot catches a Pokemon i get this Exception which causes reauthentification. This only happens since today. Niantic must have changed something with their servers or somethin. Tried to track down the issue by looking at the code but couldnt figure it out.

Line 68,demo.py - 2016-08-01 20:50:40,519 - INFO - ZUBAT, 53.002505 meters away Line 391,demo.py - 2016-08-01 20:50:40,521 - CRITICAL - Exception raised: 'MapPokemon' object has no attribute 'pokemon_data' Line 83,api.py - 2016-08-01 20:50:40,522 - INFO - Creating Google session for XXXXXXXX Line 788,connectionpool.py - 2016-08-01 20:50:40,531 - INFO - Starting new HTTPS connection (1): android.clients.google.com Line 788,connectionpool.py - 2016-08-01 20:50:41,406 - INFO - Starting new HTTPS connection (1): android.clients.google.com

Anyone had any success with this?

dnsBlah commented 8 years ago

use this for getting pokemon id

pokemonId = getattr(pokemon, "pokemon_id", None)
            if not pokemonId:
                pokemonId = pokemon.pokemon_data.pokemon_id

There is not always a pokemon_data inside pokemon. Depends on the type of pokemon you find

dmadisetti commented 8 years ago

? Do you have any examples @dnsBlah

dnsBlah commented 8 years ago

lately I found that catchable and nearby pokemon are 1 and the same, I do a double check after I filter the pokemon out, I loop to only return unique encounter ids sometimes its double simetimes its not one of the 2 types has pokemon_id directly and missing pokemon_data

thats why I get the id as mentioned in my previous comment