Skip to content

Commit

Permalink
Added optional argument for own PTC login client secret
Browse files Browse the repository at this point in the history
  • Loading branch information
tejado committed Jul 15, 2016
1 parent 6a1b224 commit d0642a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
Expand Down Expand Up @@ -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,
}
Expand All @@ -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()

Expand All @@ -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)
Expand Down

0 comments on commit d0642a9

Please sign in to comment.