If not self. Print(getMyTime(), "called get_specific_api_endpoint") Print("post exception", traceback.format_exc()) If b'Server Error' in r.content: raise Exception('invalid niantic server response') R = requests_session.post(endpoint, base64.b64decode(data), verify=False) R = requests_session.post(endpoint, data, verify=False) Requests_session = self._requests_skiplagged_session if is_skiplagged_api else self._requests_niantic_session It has in depth statistics on Pokemon moves and types, and a widget for seleting and sorting Pokemon by attack, defense, and stamina. Is_skiplagged_api = 'skiplagged' in endpoint PokeLinker provides Pokemon GO players with a real-time map of the world containing recent Pokemon sightings. If th_provider = 'google': return self.login_with_google(self._username, self._password)Įlif th_provider = 'ptc': return self.login_with_pokemon_trainer(self._username, self._password)ĭef get_access_token(self): return self._access_tokenĭef get_auth_provider(self): return self._auth_provider If not self.is_logged_in(): raise Exception('needs an existing log in') Return (self._auth_provider, self._access_token)ĭef is_logged_in(self): return self._access_token is not None If not access_token or 'error' in access_token: raise Exception('failed to get access_token')ĭef _update_login(self, auth_provider, access_token, username, password): Print(getMyTime(), "called login_with_pokemon_trainer")Īuth_provider = ptc_auth.get_auth_provider()Īccess_token = ptc_auth.get_access_token(username, password).decode() Return self._update_login(auth_provider, access_token, username, password)ĭef login_with_pokemon_trainer(self, username, password): Print(getMyTime(), "called login_with_google")Īuth_provider = google_auth.get_auth_provider()Īccess_token = google_auth.get_access_token(username, password) Self._requests_niantic_session = get_requests_session('Niantic App')ĭef login_with_google(self, username, password): Self._requests_skiplagged_session = get_requests_session('pokemongo-python') St = (ts).strftime('%H:%M:%S')Ĭ_task(my_background_task())Ī guy said me that the problem is in the skiplagged.py because it uses request.Ĭan you help me to convert the script from requests lib to aiohttp? import base64įrom auth.pokemon_trainer_club import PokemonTrainerClubįrom utils.general import get_requests_sessionĭef getMyTime(): return strftime("%d/%m/%Y %H:%M:%S", localtime()) Print(pf.login_with_pokemon_trainer('ptc_id', 'ptc_psw')) # print client.login_with_google('GOOGLE_EMAIL', 'PASSWORD') # Log in with a Google or Pokemon Trainer Club account
# bounds = client.get_bounds_for_address('Central Park, NY')
I'm not really good with python so if u want to explain i'll be glad to learn import discordĬhannel = discord.Object(id='channel_id') I'm trying to make a bot for discord that send some coords to the chat channel, but when i run it after 2 minutes it stops giving the error the task was destroyed.