From d0642a91926dacdd8279d31a3782b2d1e37eb42c Mon Sep 17 00:00:00 2001 From: tjadoe Date: Fri, 15 Jul 2016 08:05:20 +0200 Subject: [PATCH] Added optional argument for own PTC login client secret --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7efdbbe9..f9f5545a 100644 --- a/main.py +++ b/main.py @@ -15,6 +15,7 @@ API_URL = 'https://pgorelease.nianticlabs.com/plfe/rpc' LOGIN_URL = 'https://sso.pokemon.com/sso/login?service=https%3A%2F%2Fsso.pokemon.com%2Fsso%2Foauth2.0%2FcallbackAuthorize' LOGIN_OAUTH = 'https://sso.pokemon.com/sso/oauth2.0/accessToken' +PTC_CLIENT_SECRET = 'w8ScCUXJQc6kXKw8FiOhd8Fixzht18Dq3PEVkUCP5ZPxtgyWsbTvWHFLm2wNY0JR' SESSION = requests.session() SESSION.headers.update({'User-Agent': 'Niantic App'}) @@ -135,7 +136,7 @@ def login_ptc(username, password): data1 = { 'client_id': 'mobile-app_pokemon-go', 'redirect_uri': 'https://www.nianticlabs.com/pokemongo/error', - 'client_secret': 'w8ScCUXJQc6kXKw8FiOhd8Fixzht18Dq3PEVkUCP5ZPxtgyWsbTvWHFLm2wNY0JR', + 'client_secret': PTC_CLIENT_SECRET, 'grant_type': 'refresh_token', 'code': ticket, } @@ -152,6 +153,7 @@ def main(): parser.add_argument("-p", "--password", help="PTC Password", required=True) parser.add_argument("-l", "--location", help="Location", required=True) parser.add_argument("-d", "--debug", help="Debug Mode", action='store_true') + parser.add_argument("-s", "--client_secret", help="PTC Client Secret") parser.set_defaults(DEBUG=True) args = parser.parse_args() @@ -160,6 +162,10 @@ def main(): DEBUG = True print('[!] DEBUG mode on') + if args.client_secret is not None: + global PTC_CLIENT_SECRET + PTC_CLIENT_SECRET = args.client_secret + set_location(args.location) access_token = login_ptc(args.username, args.password)