-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsessionspoof.py
56 lines (48 loc) · 1.68 KB
/
sessionspoof.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Credit: verticalsync
# Github: https://github.com/verticalsync
# Discord: verticalsync.
# I have slightly modified the code to add different devices.
import uuid
from discord.gateway import DiscordWebSocket
properties = {
"mobile": ["iOS", "Discord iOS", "iOS"],
"desktop": ["Windows", "Discord Client", "Windows"],
"web": ["Windows", "Chrome", "Windows"],
"embedded": ["Xbox", "Discord Embedded", "Xbox"],
}
original_method = None
os = "mobile"
async def new_method(self):
if original_method is None:
return await self._identify()
if os.lower() == "mobile":
# credits: jsoncitron
# issue: #16
self._super_properties = {
'os': 'Android',
'browser': 'Discord Android',
'device': 'emu64x',
'system_locale': 'en-GB',
'has_client_mods': False,
'client_version': '267.0 - rn',
'release_channel': 'alpha',
'device_vendor_id': str(uuid.uuid4()),
'design_id': 2,
'browser_user_agent': '', # Not provided here but the user agent is Discord-Android/267200;RNA
'browser_version': '',
'os_version': '34',
'client_build_number': 3616,
'client_event_source': None,
}
else:
self._super_properties["$os"] = properties[os][0]
self._super_properties["$browser"] = properties[os][1]
self._super_properties["$device"] = properties[os][2]
return await original_method(self)
def patch_identify(new_os):
global original_method, os
if new_os not in properties:
os = "desktop"
os = new_os
original_method = DiscordWebSocket.identify
DiscordWebSocket.identify = new_method