0% found this document useful (0 votes)
5 views5 pages

message (4)

The document is a Python script that implements a Discord vanity URL sniper using asynchronous programming with aiohttp and a custom TLS client. It connects to Discord's WebSocket API and listens for updates on specified guilds, attempting to claim vanity URLs when they become available. The script includes error handling and multi-threading for efficient operation during the URL sniping process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

message (4)

The document is a Python script that implements a Discord vanity URL sniper using asynchronous programming with aiohttp and a custom TLS client. It connects to Discord's WebSocket API and listens for updates on specified guilds, attempting to claim vanity URLs when they become available. The script includes error handling and multi-threading for efficient operation during the URL sniping process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

import aiohttp

import json
import os
import asyncio
from tls_client import Session
import re
import time
import threading

token = "MTM0NDkyODQ2MjI5MjUxNjkyNg.GGARxN.ZA8SlH5vi8CDvncmlWhH1Bvq7GJ_p6MpXAdQqE"
# TOKEN
reciever = '1336062874384203796' # Vanity Reciever Guild
password = 'destroyerraand'

o1 = {
'1336062874384203796': 'jini', # target server id and target server vanity
}

async def fetch_build_number() -> int:


try:
async with aiohttp.ClientSession() as session:
async with session.get("https://discord.com/login") as response:
text = await response.text()
x3 =
re.findall(r'<script\s+src="([^"]+\.js)"\s+defer>\s*</script>', text)
for x4 in x3:
async with session.get(f"https://discord.com/{x4}") as
x5_response:
x5_text = await x5_response.text()
if "buildNumber" in x5_text:
build_number = x5_text.split('build_number:"')
[1].split('"')[0]
print(build_number)
return int(build_number)
except Exception as e:
print("Error in fetch_build_number:", e)
return None

class A1:
def __init__(self, k1: str) -> None:
self.k1 = k1
self.x6 = None
self.x7 = None
self.x8 = None
self.x9 = []
self.x10 = None
self.session = Session(client_identifier='chrome_117',
random_tls_extension_order=True)

def y1(self, k3, x11, x12):


x13 = "https://discord.com/api/v9/mfa/finish"
x14 = {
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'authorization': self.k1,
'content-type': 'application/json',
'origin': 'https://discord.com',
'priority': 'u=1, i',
'referer': 'https://discord.com/channels/@me',
'sec-ch-ua': '"Chromium";v="128", "Not;A=Brand";v="24", "Google
Chrome";v="128"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
'x-debug-options': 'bugReporterEnabled',
'x-discord-locale': 'en-US',
'x-discord-timezone': 'America/New_York',
'x-super-properties':
'eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwic3lzdGVtX2xvY2FsZS
I6ImVuLVVTIiwiYnJvd3Nlcl91c2VyX2FnZW50IjoiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV
2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEyOC4w
LjAuMCBTYWZhcmkvNTM3LjM2IiwiYnJvd3Nlcl92ZXJzaW9uIjoiMTI4LjAuMC4wIiwib3NfdmVyc2lvbiI
6IjEwIiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIiwicmVmZXJyZXJfY3VycmVudCI6Ii
IsInJlbGVhc2VfY2hhbm5lbCI6InN0YWJsZSIsImNsaWVudF9idWlsZF9udW1iZXIiOjMyODY5NywiY2xpZ
W50X2V2ZW50X3NvdXJjZSI6bnVsbH0=',
}
x15 = {
'ticket': x11,
'mfa_type': 'password',
'data': k3,
}
try:
x16 = self.session.post(x13, json=x15, headers=x14, cookies=x12)
print(x16.json())
return x16.json()['token'], x16.cookies.get('__Secure-recent_mfa')
except Exception as e:
print("Error in y1:", e)
return None, None

def y2(self, x17, k3):


x18 = f"https://discord.com/api/v9/guilds/{reciever}/vanity-url"
x19 = {
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'authorization': self.k1,
'content-type': 'application/json',
'origin': 'https://discord.com',
'priority': 'u=1, i',
'referer': 'https://discord.com/channels/@me',
'sec-ch-ua': '"Chromium";v="128", "Not;A=Brand";v="24", "Google
Chrome";v="128"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
'x-debug-options': 'bugReporterEnabled',
'x-discord-locale': 'en-US',
'x-discord-timezone': 'America/New_York',
'x-discord-mfa-authorization': self.x10,
'x-super-properties':
'eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwic3lzdGVtX2xvY2FsZS
I6ImVuLVVTIiwiYnJvd3Nlcl91c2VyX2FnZW50IjoiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV
2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEyOC4w
LjAuMCBTYWZhcmkvNTM3LjM2IiwiYnJvd3Nlcl92ZXJzaW9uIjoiMTI4LjAuMC4wIiwib3NfdmVyc2lvbiI
6IjEwIiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIiwicmVmZXJyZXJfY3VycmVudCI6Ii
IsInJlbGVhc2VfY2hhbm5lbCI6InN0YWJsZSIsImNsaWVudF9idWlsZF9udW1iZXIiOjMyODY5NywiY2xpZ
W50X2V2ZW50X3NvdXJjZSI6bnVsbH0=',
}

try:
starttime = time.time()
x20 = self.session.patch(x18, json={'code': x17}, headers=x19)
if x20.status_code == 200:
print(f"Sniped Vanity {x17}")
elif 'mfa' in x20.text:
x21 = x20.json()['mfa']['ticket']
x22 = x20.cookies
x23, x24 = self.y1(k3, x21, x22)
self.x10 = x23
if not x23:
print("Failed to get MFA token")
return
x25 = {
'__Secure-recent_mfa': x24,
'__dcfduid': x22.get('__dcfduid'),
'__sdcfduid': x22.get('__sdcfduid'),
'__cfruid': x22.get('__cfruid'),
'_cfuvid': x22.get('_cfuvid'),
}
x19['x-discord-mfa-authorization'] = self.x10
threading.Thread(target=self.patchboi, args=(x18, {'code': x17},
x19, x25)).start()
endtime = time.time()
print(f"Request completed in {endtime - starttime:.2f} seconds")
except Exception as e:
print("Error in y2:", e)

def patchboi(self, x18, jsonn, headers, cookies):


try:
x26 = self.session.patch(x18, json=jsonn, headers=headers,
cookies=cookies)
if x26.status_code == 200:
print(f"Sniped Vanity {jsonn.get('code')}")
except Exception as e:
print("Error in patchboi:", e)

async def y3(self):


try:
async with aiohttp.ClientSession() as x27:
async with x27.ws_connect("wss://gateway.discord.gg/?
encoding=json&v=9") as x28:
await self.y4(x28)
self.x9 = [self.y5(x28)]
await asyncio.gather(*self.x9)
except Exception as x29:
print(f"Error starting connection: {x29}")

async def y4(self, x28):


try:
await x28.send_json({
"op": 2,
"d": {
"token": self.k1,
"capabilities": 30717,
"properties": {
"os": "Windows",
"browser": "Chrome",
"device": "Desktop",
"system_locale": "en-US",
"browser_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64;
x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"browser_version": "117.0.0.0",
"os_version": "10",
"referrer": "",
"referring_domain": "",
"referrer_current": "",
"referring_domain_current": "",
"release_channel": "stable",
"client_build_number": await fetch_build_number(),
"client_event_source": None
},
"presence": {
"afk": False,
"since": time.time(),
"activities": [{
"name": 'running sniper',
"type": 0,
}],
"status": "unknown"
},
"compress": False,
"client_state": {
"guild_versions": {}
}
}
})
except Exception as x30:
print(f"Error sending initial presence: {x30}")

async def y6(self, x28):


while True:
try:
async for x31 in x28:
x32 = json.loads(x31.data)
if "s" in x32:
self.x6 = x32["s"]
if "resume_gateway_url" in x32:
self.x7 = x32["d"]["session_id"]
self.x8 = x32["d"]["resume_gateway_url"] + '/?
encoding=json&v=9'
print("online with -> " + self.x7)
except Exception as x33:
print(f"Error during event handling: {x33}")

async def y5(self, x28):


try:
async for x31 in x28:
x32 = json.loads(x31.data)
if x32["op"] == 10:
x34 = int(x32["d"]["heartbeat_interval"]) / 1000
asyncio.create_task(self.y7(x28, x34))
if x32.get('t') == 'GUILD_UPDATE':
if x32['d']['id'] in o1 and o1[x32['d']['id']] != x32['d']
['vanity_url_code']:
threading.Thread(target=self.y2, args=(o1[x32['d']['id']],
password)).start()
except Exception as x35:
print(f"Event handling err: {x35}")

async def y7(self, x28, x34):


try:
while True:
x36 = {"op": 1, "d": self.x6}
await x28.send_json(x36)
await asyncio.sleep(x34)
except Exception as x37:
print(f"Heartbeat err: {x37}")

async def z2():


os.system('cls' if os.name=='nt' else 'clear')
try:
print("Started Vanity Sniper")
x38 = A1(token)
await x38.y3()
except Exception as x39:
print(f"Err: {x39}")

if __name__ == "__main__":
asyncio.run(z2())

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy