-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
119 lines (109 loc) · 3.52 KB
/
Copy pathmain.py
File metadata and controls
119 lines (109 loc) · 3.52 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import json, os, random, threading, time, websocket, delorean
os.system("pip install websocket-client delorean")
os.system(
"sleep 2 && clear >/dev/null 2>&1 &"
if os.name == "posix"
else "timeout /t 2 >nul 2>&1 && cls"
)
from datetime import datetime, timezone
from ghostyalive import Gghostyhandle
class GhoStyM:
def __init__(self):
self.tokens = []
self.nonce = lambda: str(random.randint(1000000000, 9999999999))
self.gghostySpoActs = {}
self.activities = {}
with open("ghostydata/config.json") as f:
self.config = json.load(f)
with open("ghostydata/ghostysongs.json", encoding="utf8") as f:
self.songs = json.load(f)
for line in open("ghostydata/tokens.txt"):
token = line.strip().split(":")[0]
self.tokens.append(token)
self.ack = json.dumps({"op": 1, "d": None})
def rotatorghostyspotify(self, token: str):
song = random.choice(self.songs)["track"]
artistIds = [artist["id"] for artist in song["artists"]]
songStart = int(delorean.Delorean(datetime.utcnow(), timezone="UTC").epoch) * 1000
songEnd = songStart + song["duration_ms"]
self.gghostySpoActs[token] = {
'songStart': songStart,
'songEnd': songEnd
}
activities = [{
"type": 2,
"name": "Spotify",
"assets": {
"large_image": "spotify:%s" % (song["album"]["images"][0]["url"].split("https://i.scdn.co/image/")[1]),
"large_text": song["album"]["name"]
},
"details": song["name"],
"state": song["artists"][0]["name"],
"timestamps": {
"start": songStart,
"end": songEnd
},
"party": {
"id": "spotify:%s" % (self.nonce())
},
"sync_id": song["external_urls"]["spotify"].split("https://open.spotify.com/track/")[1],
"flags": 48,
"metadata": {
"album_id": song["album"]["id"],
"artist_ids": artistIds
}
}]
payload = json.dumps({
"op": 3,
"d": {
"since": 0,
"activities": activities,
"status": random.choice(["idle"]),
"afk": False
}
})
self.activities[token] = payload
return payload
def oneconghostysg(self, token: str):
try:
if ":" in token:
token = token.split(":")[2]
except IndexError:
pass
try:
ws = websocket.WebSocket()
ws.connect("wss://gateway.discord.gg/?v=6&encoding=json")
data = json.loads(ws.recv())
ws.send(json.dumps({
"op": 2,
"d": {
"token": token,
"properties": {
"$os": "Windows",
"$browser": "Discord Client",
"$device": "Windows"
}
}
}))
time.sleep(1)
ws.send(self.rotatorghostyspotify(token))
ws.send(self.ack)
time.sleep(5)
ws.close()
except Exception as e:
print(f"❌ Connection failed for {token[:20]}: {e}")
def wallighostyg(self, token: str):
while True:
self.oneconghostysg(token)
time.sleep(2)
if __name__ == "__main__":
Gghostyhandle()
discord = GhoStyM()
for i, token in enumerate(discord.tokens, 1):
time.sleep(0.8)
print(f"✅ [{i}] Started token: {token[:20]}")
threading.Thread(target=discord.wallighostyg, args=(token,)).start()
time.sleep(1)
print("Running Spotify Rotator [ @ghostyjija Async Dev ]")
time.sleep(1000)
os.system("kill 1")