-
-
Save ctian1/a249604f9143741bd76e45133b5e1de8 to your computer and use it in GitHub Desktop.
Revisions
-
Luc1412 revised this gist
Apr 18, 2020 . 1 changed file with 10 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,55 +1,50 @@ import re import aiohttp async def run(username, password): session = aiohttp.ClientSession() data = { 'client_id': 'play-valorant-web-prod', 'nonce': '1', 'redirect_uri': 'https://beta.playvalorant.com/opt_in', 'response_type': 'token id_token', } await session.post('https://auth.riotgames.com/api/v1/authorization', json=data) data = { 'type': 'auth', 'username': username, 'password': password } async with session.put('https://auth.riotgames.com/api/v1/authorization', json=data) as r: data = await r.json() pattern = re.compile('access_token=((?:[a-zA-Z]|\d|\.|-|_)*).*id_token=((?:[a-zA-Z]|\d|\.|-|_)*).*expires_in=(\d*)') data = pattern.findall(data['response']['parameters']['uri'])[0] access_token = data[0] print('Access Token: ' + access_token) id_token = data[1] expires_in = data[2] headers = { 'Authorization': f'Bearer {access_token}', } async with session.post('https://entitlements.auth.riotgames.com/api/token/v1', headers=headers, json={}) as r: data = await r.json() entitlements_token = data['entitlements_token'] print('Entitlements Token: ' + entitlements_token) async with session.post('https://auth.riotgames.com/userinfo', headers=headers, json={}) as r: data = await r.json() user_id = data['sub'] print('User ID: ' + user_id) headers['X-Riot-Entitlements-JWT'] = entitlements_token # Example Request. (Access Token and Entitlements Token needs to be included!) async with session.get(f'https://pd.eu.a.pvp.net/match-history/v1/history/{user_id}?startIndex=0&endIndex=10', headers=headers) as r: data = json.loads(await r.text()) print(data) await session.close() if __name__ == '__main__': asyncio.get_event_loop().run_until_complete(run('exmaple user name', 'my_secret_password')) -
Luc1412 revised this gist
Apr 18, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,8 @@ import re import aiohttp async def run(): session = aiohttp.ClientSession() data = { 'client_id': 'play-valorant-web-prod', 'nonce': '1', -
Luc1412 revised this gist
Apr 18, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,8 +16,8 @@ async def run(): data = { 'type': 'auth', 'username': '', 'password': '' } print(session.cookie_jar) async with session.put('https://auth.riotgames.com/api/v1/authorization', json=data) as r: -
Luc1412 revised this gist
Apr 18, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ import re import async def run(): session = aiohttp.ClientSession() #{"client_id":"play-valorant-web-prod","nonce":"ODMsMjE3LDE4Miwx","prompt":"login","redirect_uri":"https://beta.playvalorant.com/opt_in","response_type":"token id_token","scope":"account openid","state":"bG9naW4=","ui_locales":"en-us"} @@ -11,7 +14,6 @@ async def run(): print(r.status) print(await r.text()) data = { 'type': 'auth', 'username': 'Luc1412', -
Luc1412 created this gist
Apr 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ async def run(): session = aiohttp.ClientSession() #{"client_id":"play-valorant-web-prod","nonce":"ODMsMjE3LDE4Miwx","prompt":"login","redirect_uri":"https://beta.playvalorant.com/opt_in","response_type":"token id_token","scope":"account openid","state":"bG9naW4=","ui_locales":"en-us"} data = { 'client_id': 'play-valorant-web-prod', 'nonce': '1', 'redirect_uri': 'https://beta.playvalorant.com/opt_in', 'response_type': 'token id_token', } async with session.post('https://auth.riotgames.com/api/v1/authorization', json=data) as r: print(r.status) print(await r.text()) # {"type":"auth","username":"Luc1412","password":"7obbkjCWlvjXOoO2bn3@","remember":true,"language":"en_US"} data = { 'type': 'auth', 'username': 'Luc1412', 'password': '7obbkjCWlvjXOoO2bn3@' } print(session.cookie_jar) async with session.put('https://auth.riotgames.com/api/v1/authorization', json=data) as r: print(r.status) data = await r.json() pattern = re.compile('access_token=((?:[a-zA-Z]|\d|\.|-|_)*).*id_token=((?:[a-zA-Z]|\d|\.|-|_)*).*expires_in=(\d*)') data = pattern.findall(data['response']['parameters']['uri'])[0] access_token = data[0] print(access_token) id_token = data[1] expires_in = data[2] headers = { 'Authorization': f'Bearer {access_token}', } async with session.post('https://entitlements.auth.riotgames.com/api/token/v1', headers=headers, json={}) as r: print(r.status) data = await r.json() entitlements_token = data['entitlements_token'] print(entitlements_token) async with session.post('https://auth.riotgames.com/userinfo', headers=headers, json={}) as r: print(r.status) data = await r.json() user_id = data['sub'] print(user_id) headers['X-Riot-Entitlements-JWT'] = entitlements_token async with session.get(f'https://pd.eu.a.pvp.net/match-history/v1/history/{user_id}?startIndex=0&endIndex=10', headers=headers) as r: print(r.status) data = json.loads(await r.text()) print(data) await session.close() if __name__ == '__main__': asyncio.get_event_loop().run_until_complete(run())