Kyotest

Ubisoft Block Listener - Kyo

Aug 8th, 2022
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. import asyncio, websockets,json,base64,requests,webbrowser
  2.  
  3. heads = {
  4. "Accept": "application/json",
  5. "Ubi-AppId": 'f35adcb5-1911-440c-b1c9-48fdc1701c68',
  6. "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",
  7. "Ubi-RequestedPlatformType": "uplay",
  8. "Content-Type": "application/json"
  9. }
  10.  
  11.  
  12. def login(logi):
  13. heads['Authorization'] = 'Basic ' + base64.b64encode(bytes(logi, "utf-8")).decode("utf-8")
  14. r = requests.post("https://public-ubiservices.ubi.com/v2/profiles/sessions", headers=heads)
  15. if r.status_code == 200:
  16. res = r.json()
  17. heads['Authorization'] = 'ubi_v1 t='+ res['ticket']
  18. heads['Ubi-sessionId'] = res['sessionId']
  19. print('Logged into: {}'.format(res['nameOnPlatform']))
  20. return True
  21. else:
  22. return False
  23.  
  24.  
  25. async def handler(websocket):
  26. while True:
  27. message = await websocket.recv()
  28. data = json.loads(message)
  29. if data['notificationType'] == 'BLOCKLIST_ADD':
  30. pid = data['content']['blockedProfileId']
  31. print(f'Loading: {pid}')
  32. webbrowser.open(f'{url}{pid}', new=2)
  33.  
  34.  
  35. async def main():
  36. 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"
  37. async with websockets.connect(url,extra_headers=heads) as ws:
  38. await handler(ws)
  39. await asyncio.Future() # run forever
  40.  
  41.  
  42.  
  43. if __name__ == "__main__":
  44.  
  45. email='emailhere'
  46. passw='passwordhere'
  47.  
  48. ## Can use
  49. url = 'https://tabstats.com/siege/player/id/'
  50. # url = 'https://r6.tracker.network/profile/id/'
  51.  
  52. logi = f'{email}:{passw}'
  53. status = login(logi)
  54. if status:
  55. asyncio.run(main())
  56.  
Add Comment
Please, Sign In to add comment