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

BadHashRequestException

Open Yasheshpandita opened this issue 9 years ago • 6 comments

File "pokecli.py", line 865, in main() File "pokecli.py", line 195, in main bot = start_bot(bot, config) File "pokecli.py", line 147, in start_bot bot.start() File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 155, in start self._setup_api() File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 1149, in _setup_api self.login() File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 957, in login str(self.config.password)) File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/api_wrapper.py", line 108, in login response = PGoApi.app_simulation_login(self) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/pgoapi.py", line 152, in app_simulation_login response = request.call() File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/pgoapi.py", line 264, in call response = request.request(self._api_endpoint, self._req_method_list, self.get_position()) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/rpc_api.py", line 149, in request self.request_proto = self.request_proto or self._build_main_request(subrequests, player_position) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/rpc_api.py", line 229, in _build_main_request self._hash_engine.hash(sig.timestamp, request.latitude, request.longitude, request.accuracy, ticket_serialized, sig.session_hash, request.requests) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/hash_server.py", line 48, in hash raise BadHashRequestException("400: Bad request, error: {}".format(response.text)) pgoapi.exceptions.BadHashRequestException: 400: Bad request, error: Unauthorized [2017-03-29 01:00:16] [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/) Traceback (most recent call last): File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1042, in request self._send_request(method, url, body, headers) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1082, in _send_request self.endheaders(body) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders self._send_output(message_body) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 880, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) [2017-03-29 01:00:16] [sentry.errors.uncaught] [ERROR] [u'BadHashRequestException: 400: Bad request, error: Unauthorized', u' File "pokecli.py", line 865, in ', u' File "pokecli.py", line 195, in main', u' File "pokecli.py", line 147, in start_bot', u' File "pokemongo_bot/init.py", line 155, in start', u' File "pokemongo_bot/init.py", line 1149, in _setup_api', u' File "pokemongo_bot/init.py", line 957, in login', u' File "pokemongo_bot/api_wrapper.py", line 108, in login', u' File "pgoapi/pgoapi.py", line 152, in app_simulation_login', u' File "pgoapi/pgoapi.py", line 264, in call', u' File "pgoapi/rpc_api.py", line 149, in request', u' File "pgoapi/rpc_api.py", line 229, in _build_main_request', u' File "pgoapi/hash_server.py", line 48, in hash']

Yasheshpandita avatar Mar 28 '17 19:03 Yasheshpandita

looks like wrong/missing hashing key

pogarek avatar Mar 28 '17 19:03 pogarek

Server is throttling, reconnecting in 853 seconds Exception in thread Thread-4: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 1073, in run self.function(*self.args, **self.kwargs) File "/Users/yasheshpandita/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 1510, in heartbeat responses = request.call() File "/Users/yasheshpandita/Desktop/PokemonGo-Bot-master/pokemongo_bot/api_wrapper.py", line 222, in call raise ServerSideRequestThrottlingException('Server throttled too many times') ServerSideRequestThrottlingException: Server throttled too many times

Yasheshpandita avatar Mar 30 '17 09:03 Yasheshpandita

This occurs like 5-6 times before it is sucessful. What should be done ?? And the bot works for like 5 mins max before giving the same exception.

Yasheshpandita avatar Mar 30 '17 09:03 Yasheshpandita

So did you have a vaild hash key?

It is no longer possible to run the bot without hashing service.

MerlionRock avatar Mar 31 '17 04:03 MerlionRock

Yes i do. And it runs for sometime then gets disconnected.

Yasheshpandita avatar Mar 31 '17 06:03 Yasheshpandita

Closing old issue, if you think this is an error let me know or open a new issue. Thank you.

davidakachaos avatar Jul 12 '17 23:07 davidakachaos