Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncio, websockets,json,base64,requests,webbrowser
- heads = {
- "Accept": "application/json",
- "Ubi-AppId": 'f35adcb5-1911-440c-b1c9-48fdc1701c68',
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
- "Ubi-RequestedPlatformType": "uplay",
- "Content-Type": "application/json"
- }
- def login(logi):
- heads['Authorization'] = 'Basic ' + base64.b64encode(bytes(logi, "utf-8")).decode("utf-8")
- r = requests.post("https://public-ubiservices.ubi.com/v2/profiles/sessions", headers=heads)
- if r.status_code == 200:
- res = r.json()
- heads['Authorization'] = 'ubi_v1 t='+ res['ticket']
- heads['Ubi-sessionId'] = res['sessionId']
- print('Logged into: {}'.format(res['nameOnPlatform']))
- return True
- else:
- return False
- async def handler(websocket):
- while True:
- message = await websocket.recv()
- data = json.loads(message)
- if data['notificationType'] == 'BLOCKLIST_ADD':
- pid = data['content']['blockedProfileId']
- print(f'Loading: {pid}')
- webbrowser.open(f'{url}{pid}', new=2)
- async def main():
- url = "wss://public-ws-ubiservices.ubi.com/v2/websocket?SpaceIds=ec66c7e2-7b44-471c-a3ab-9d1da48153c3%2Cabb909cd-ebaa-4ba5-a4a5-afa75cae8195%2C45d58365-547f-4b45-ab5b-53ed14cc79ed&NotificationTypes=BLOCKLIST_ADD,FRIENDS_RELATIONSHIP_TRIGGER"
- async with websockets.connect(url,extra_headers=heads) as ws:
- await handler(ws)
- await asyncio.Future() # run forever
- if __name__ == "__main__":
- email='emailhere'
- passw='passwordhere'
- ## Can use
- url = 'https://tabstats.com/siege/player/id/'
- # url = 'https://r6.tracker.network/profile/id/'
- logi = f'{email}:{passw}'
- status = login(logi)
- if status:
- asyncio.run(main())
Add Comment
Please, Sign In to add comment