PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Get player info bug

Open Niespo opened this issue 10 years ago • 5 comments

On branch "stable", I have a KeyError caused by different structure of response_dict than expected

[2016-07-24 13:05:28] [x] Position in-game set as: (51.11167589999999, 17.0605103, 0.0) [2016-07-24 13:05:28] Traceback (most recent call last): File "pokecli.py", line 197, in main() File "pokecli.py", line 183, in main bot.start() File "D:\IdeaProjects\pokemon-go\PokemonGo-Bot\pokemongo_bot__init__.py", line 31, in start self.setup_api() File "D:\IdeaProjects\pokemon-go\PokemonGo-Bot\pokemongo_bot__init_.py", line 179, in _setup_api player = response_dict['responses']['GET_PLAYER']['player_data'] KeyError: 'player_data'

Niespo avatar Jul 24 '16 11:07 Niespo

Check your release_config.json file that the syntax is all correct. I had an extra comma in mine which prevented the program from running.

celinereine avatar Jul 24 '16 11:07 celinereine

@celinereine but my problem is with wrong format of response from PoGoAPI I guess, not with wrong parsing release_config.json.

Niespo avatar Jul 24 '16 11:07 Niespo

I have the same issue, I seams that the response format has change:

{
  "unknown2": xxxx, 
  "direction": 1, 
  "auth_ticket": {
    "expire_timestamp_ms": xxxx, 
    "start": "xxxx", 
    "end": "xxx==\n"
  }, 
  "responses": {
    "GET_PLAYER": {
      "profile": {
        "username": "xxx", 
        "item_storage": 350, 
        "unknown12": "", 
        "unknown13": "", 
        "creation_time": xxx, 
        "currency": [
          {
            "type": "POKECOIN"
          }, 
          {
            "amount": 1100, 
            "type": "STARDUST"
          }
        ], 
        "daily_bonus": {}, 
        "avatar": {
          "unknown2": 2, 
          "unknown3": 2, 
          "unknown9": 4, 
          "unknown10": 1
        }, 
        "tutorial": "", 
        "poke_storage": 250
      }, 
      "unknown1": 1
    }
  }
}

tdurieux avatar Jul 24 '16 15:07 tdurieux

Any solution for this?

Aphoh avatar Jul 24 '16 18:07 Aphoh

SOLVED!

I had to remove pgoapi folder from project's root directory. I guess that has to link this old api version instead of new one which place in python lib dir

Niespo avatar Jul 24 '16 20:07 Niespo