Skip to content

Commit

Permalink
Merge pull request #6 from ZeChrales/patch-1
Browse files Browse the repository at this point in the history
fix code 403 errors and most of errors 409
  • Loading branch information
Noctem committed Jun 25, 2017
2 parents 1bac0bd + 3d50feb commit 064ba98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aiopogo/auth_ptc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ async def user_login(self, username=None, password=None):
async with ClientSession(
connector=SESSIONS.get_connector(self.socks),
loop=self.loop,
headers=(('User-Agent', 'niantic'),
('Host', 'sso.pokemon.com')),
headers=(('User-Agent', 'pokemongo/1 CFNetwork/811.4.18 Darwin/16.5.0'),
('Host', 'sso.pokemon.com'),
('X-Unity-Version', '5.5.1f1')),
skip_auto_headers=('Accept', 'Accept-Encoding'),
request_class=ProxyClientRequest if self.socks else ClientRequest,
connector_owner=False,
raise_for_status=True,
conn_timeout=5.0,
read_timeout=self.timeout) as session:
async with session.get('https://sso.pokemon.com/sso/oauth2.0/authorize', params={'client_id': 'mobile-app_pokemon-go', 'redirect_uri': 'https://www.nianticlabs.com/pokemongo/error', 'locale': self.locale}, proxy=self.proxy, proxy_auth=self.proxy_auth) as resp:
async with session.get('https://sso.pokemon.com/sso/oauth2.0/authorize', headers={'Content-Length': '-1'}, params={'client_id': 'mobile-app_pokemon-go', 'redirect_uri': 'https://www.nianticlabs.com/pokemongo/error', 'locale': self.locale}, proxy=self.proxy, proxy_auth=self.proxy_auth) as resp:
data = await resp.json(loads=json_loads, encoding='utf-8', content_type=None)

assert 'lt' in data
Expand Down

0 comments on commit 064ba98

Please sign in to comment.