-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
132 lines (114 loc) · 5.53 KB
/
main.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
from datetime import datetime
import threading
from time import sleep
import json
import os
try:
import tls_client
import colorama
import pystyle
import sys
except:
os.system("pip install tls_client")
os.system("pip install colorama")
os.system("pip install pystyle")
os.system("pip install sys")
from colorama import Fore, init, Back
from pystyle import Write, Colors
print_lock = threading.Lock()
def time_rn():
current_datetime = datetime.now()
current_hour = current_datetime.hour
current_minute = current_datetime.minute
return ("{:02d}:{:02d}".format(current_hour, current_minute))
class OperaGX:
def __init__(self):
self.session = tls_client.Session(
client_identifier="chrome122")
def getData(self, session_gx: str):
self.session_gx = session_gx
headers = {
"Accept": "application/json",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Cookie": f"SESSION_TYPE=user; SESSION={self.session_gx}",
"Origin": "https://www.opera.com",
"Referer": "https://www.opera.com/",
"Sec-Ch-Ua": '"Not A(Brand";v="99", "Opera GX";v="107", "Chromium";v="121"',
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Platform": '"Windows"',
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "cross-site",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 OPR/107.0.0.0"
}
try:
r = self.session.get("https://api.gx.me/profile/token", headers=headers)
self.auth = r.json()['data']
except:
i = OperaGX()
i.getData(self.session_gx)
def getNitro(self):
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Authorization": self.auth,
"Origin": "https://www.opera.com",
"Referer": "https://www.opera.com/",
"Sec-Ch-Ua": '"Not A(Brand";v="99", "Opera GX";v="107", "Chromium";v="121"',
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Platform": '"Windows"',
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "cross-site",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 OPR/107.0.0.0"
}
try:
nitro = self.session.post("https://discord.opr.gg/v2/direct-fulfillment", headers=headers)
nitroGift = nitro.json()['token']
nitro = f"https://discord.com/billing/partner-promotions/1180231712274387115/{nitroGift}"
with open("nitro.txt",'a') as f:
f.write(f"{nitro}\n")
with print_lock:
print(f"{Fore.MAGENTA}[{Fore.RESET}{time_rn()}{Fore.MAGENTA}] {Fore.BLUE}GEN{Fore.RESET} Received Nitro ", end="")
Write.Print(f"[{nitro[0:60]}...{nitro[-10:]}]" + "\n", Colors.red_to_white, interval=0.000)
except Exception as e:
with print_lock:
print(f"{Fore.MAGENTA}[{Fore.RESET}{time_rn()}{Fore.MAGENTA}] {Fore.RED}GEN{Fore.RESET} Failed ", end="")
Write.Print(f"[{e}]" + "\n", Colors.red_to_white, interval=0.000)
sleep(1)
icon = ("""
▒█████ ██▓███ ▓█████ ██▀███ ▄▄▄ ▄████ ▒██ ██▒
▒██▒ ██▒▓██░ ██▒▓█ ▀ ▓██ ▒ ██▒▒████▄ ██▒ ▀█▒▒▒ █ █ ▒░
▒██░ ██▒▓██░ ██▓▒▒███ ▓██ ░▄█ ▒▒██ ▀█▄ ▒██░▄▄▄░░░ █ ░
▒██ ██░▒██▄█▓▒ ▒▒▓█ ▄ ▒██▀▀█▄ ░██▄▄▄▄██ ░▓█ ██▓ ░ █ █ ▒
░ ████▓▒░▒██▒ ░ ░░▒████▒░██▓ ▒██▒ ▓█ ▓██▒ ░▒▓███▀▒▒██▒ ▒██▒
░ ▒░▒░▒░ ▒▓▒░ ░ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ▒▒ ▓▒█░ ░▒ ▒ ▒▒ ░ ░▓ ░
░ ▒ ▒░ ░▒ ░ ░ ░ ░ ░▒ ░ ▒░ ▒ ▒▒ ░ ░ ░ ░░ ░▒ ░
░ ░ ░ ▒ ░░ ░ ░░ ░ ░ ▒ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░
""")
Write.Print(f"{icon}" + "\n", Colors.red_to_white, interval=0.000)
try:
with open("config.json",'r') as fart:
data = json.load(fart)
num_threads = data['numThreads']
operaSession = data['sessionID']
except Exception as e:
print(f"{Fore.MAGENTA}[{Fore.RESET}{time_rn()}{Fore.MAGENTA}] {Fore.RED}ERR{Fore.RESET} Please setup ur config.json! ", end="")
Write.Print(f"[{e}]" + "\n", Colors.red_to_white, interval=0.000)
sleep(5)
sys.exit()
def get():
i = OperaGX()
i.getData(operaSession)
i.getNitro()
threads = []
while True:
for i in range(int(num_threads)):
thread = threading.Thread(target=get, name=f"LordTheBest")
threads.append(thread)
thread.start()
for thread in threads:
thread.join()