-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto.py
273 lines (212 loc) · 12.7 KB
/
auto.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
import discord, datetime, time, flask, requests, json, threading, os, random, httpx, tls_client, sys
from flask import request
from pathlib import Path
from threading import Thread
from discord_webhook import DiscordWebhook, DiscordEmbed
from boosting import *
orders = []
config = json.load(open("config.json", encoding="utf-8"))
app = flask.Flask(__name__)
def getinviteCode(invite_input): #gets invite CODE
if "discord.gg" not in invite_input:
return invite_input
if "discord.gg" in invite_input:
invite = invite_input.split("discord.gg/")[1]
return invite
if "https://discord.gg" in invite_input:
invite = invite_input.split("https://discord.gg/")[1]
return invite
if "invite" in invite_input:
invite = invite_input.split("/invite/")[1]
return invite
@app.route("/sellix", methods=["GET", "POST"])
def sellix():
data = request.json
if data in orders:
pass
elif data not in orders:
threading.Thread(target=start_sellix, args=[data, ]).start()
orders.append(data)
return '{"status": "received"}', 200
def start_sellix(data):
try:
if 'boosts' in data['data']['product_title'].lower():
nick = ''
invite_link = ''
for i in data['data']['custom_fields']:
if i == config['field_name_invite']:
invite_link = data['data']['custom_fields'][i]
if i == "Boosting Account's Name":
nick = data['data']['custom_fields'][i].capitalize()
if nick == "":
nick = config['server_nick'].capitalize()
if data['data']['product_title'].replace(" ", "-").split("-")[0].lower() == "custom":
amount = data['data']['quantity']
if data['data']['product_title'].replace(" ", "-").split("-")[0].isdigit():
amount = int(data['data']['product_title'].replace(" ", "-").split("-")[0])
months = 3 if "3" in data['data']['product_title'].split("[")[1] else 1
invite = getinviteCode(invite_link)
order_id = data['data']['uniqid']
customer_email = data['data']['customer_email']
product_name = data['data']['product_title']
if amount % 2 != 0:
amount += 1
embed = DiscordEmbed(title = "**New Sellix Order**", description = f"**Order ID: **{order_id}\n**Product Name: **{product_name}\n**Customer Email: **{customer_email}\n\n**Invite Link: **https://discord.gg/{invite}\n**Amount: **{amount} Boosts\n**Months: **{months} Months", color = '4598d2')
embed.set_timestamp()
webhook = DiscordWebhook(url=config["order_log_webhook"])
webhook.add_embed(embed)
webhook.execute()
print()
sprint(f"Boosting https://discord.gg/{invite}, {amount} times for {months} months", True)
start = time.time()
boosted = thread_boost(invite, amount, months, nick)
end = time.time()
time_taken = round(end - start, 2)
if boosted == False:
with open('success.txt', 'w') as f:
for line in variables.success_tokens:
f.write(f"{line}\n")
with open('failed.txt', 'w') as g:
for line in variables.failed_tokens:
g.write(f"{line}\n")
embed2 = DiscordEmbed(title = "**Boosts Unsuccessful**", description = f"**Boost Type: **Automatic\n**Order ID: **{order_id}\n**Product Name: **{product_name}\n**Customer Email: **{customer_email}\n\n**Invite Link: **https://discord.gg/{invite}\n**Amount: **{amount} Boosts\n**Months: **{months} Months\n\n**Time Taken: **{time_taken} seconds\n**Successful Tokens: **{len(variables.success_tokens)}\n**Successful Boosts: **{len(variables.success_tokens)*2}\n\n**Failed Tokens: **{len(variables.failed_tokens)}\n**Failed Boosts: **{len(variables.failed_tokens)*2}", color = 'c80000')
embed2.set_timestamp()
webhook = DiscordWebhook(url=config["boost_failed_log_webhook"])
webhook.add_embed(embed2)
webhook.execute()
print()
sprint(f"Failed to Boost https://discord.gg/{invite}, {amount} times for {months} months. Operation took {time_taken} seconds", False)
print()
webhook = DiscordWebhook(url=config["boost_failed_log_webhook"])
with open("success.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='success.txt')
with open("failed.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='failed.txt')
webhook.execute()
os.remove("success.txt")
os.remove("failed.txt")
elif boosted:
with open('success.txt', 'w') as f:
for line in variables.success_tokens:
f.write(f"{line}\n")
with open('failed.txt', 'w') as g:
for line in variables.failed_tokens:
g.write(f"{line}\n")
embed3 = DiscordEmbed(title = "**Boosts Successful**", description = f"**Boost Type: **Automatic\n**Order ID: **{order_id}\n**Product Name: **{product_name}\n**Customer Email: **{customer_email}\n\n**Invite Link: **https://discord.gg/{invite}\n**Amount: **{amount} Boosts\n**Months: **{months} Months\n\n**Time Taken: **{time_taken} seconds\n**Successful Tokens: **{len(variables.success_tokens)}\n**Successful Boosts: **{len(variables.success_tokens)*2}\n\n**Failed Tokens: **{len(variables.failed_tokens)}\n**Failed Boosts: **{len(variables.failed_tokens)*2}", color = '4598d2')
embed3.set_timestamp()
webhook = DiscordWebhook(url=config["boost_log_webhook"])
webhook.add_embed(embed3)
webhook.execute()
print()
sprint(f"Boosted https://discord.gg/{invite}, {amount} times for {months} months. Operation took {time_taken} seconds", True)
print()
webhook = DiscordWebhook(url=config["boost_log_webhook"])
with open("success.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='success.txt')
with open("failed.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='failed.txt')
webhook.execute()
os.remove("success.txt")
os.remove("failed.txt")
else:
pass
except Exception as e:
#sprint(f"{e} | Function: Start_Sellix", False)
pass
@app.route("/sellapp", methods=["GET", "POST"])
def sellapp():
data = request.json
if data in orders:
pass
elif data not in orders:
threading.Thread(target=start_sellapp, args=[data, ]).start()
orders.append(data)
return 'Our server has received your order.', 200
def start_sellapp(data):
try:
nick = ''
invite_link = ''
for i in data['additional_information']:
print(i)
if i['label'] == config['field_name_invite']:
invite_link = i['value']
if i['label'] == "Boosting Account's Name":
nick = i['value'].capitalize()
if nick == "":
nick = config['server_nick'].capitalize()
if data['listing']['slug'].split("-")[0].lower() == "custom":
amount = data['quantity']
elif data['listing']['slug'].split("-")[0].isdigit():
amount = int(data['listing']['slug'].split("-")[0])
months = 3 if "3" in data['listing']['title'].split("[")[1] else 1
invite = getinviteCode(invite_link)
order_id = data['invoice']['id']
customer_email = data['invoice']['payment']['gateway']['data']['customer_email']
product_name = data['listing']['title']
if amount % 2 != 0:
amount += 1
embed = DiscordEmbed(title = "**New Sell.App Order**", description = f"**Order ID: **{order_id}\n**Product Name: **{product_name}\n**Customer Email: **{customer_email}\n\n**Invite Link: **https://discord.gg/{invite}\n**Amount: **{amount} Boosts\n**Months: **{months} Months", color = '4598d2')
embed.set_timestamp()
webhook = DiscordWebhook(url=config["order_log_webhook"])
webhook.add_embed(embed)
webhook.execute()
print()
sprint(f"Boosting https://discord.gg/{invite}, {amount} times for {months} months", True)
start = time.time()
boosted = thread_boost(invite, amount, months, nick)
end = time.time()
time_taken = round(end - start, 2)
if boosted == False:
with open('success.txt', 'w') as f:
for line in variables.success_tokens:
f.write(f"{line}\n")
with open('failed.txt', 'w') as g:
for line in variables.failed_tokens:
g.write(f"{line}\n")
embed2 = DiscordEmbed(title = "**Boosts Unsuccessful**", description = f"**Boost Type: **Automatic\n**Order ID: **{order_id}\n**Product Name: **{product_name}\n**Customer Email: **{customer_email}\n\n**Invite Link: **https://discord.gg/{invite}\n**Amount: **{amount} Boosts\n**Months: **{months} Months\n\n**Time Taken: **{time_taken} seconds\n**Successful Tokens: **{len(variables.success_tokens)}\n**Successful Boosts: **{len(variables.success_tokens)*2}\n\n**Failed Tokens: **{len(variables.failed_tokens)}\n**Failed Boosts: **{len(variables.failed_tokens)*2}", color = 'c80000')
embed2.set_timestamp()
webhook = DiscordWebhook(url=config["boost_failed_log_webhook"])
webhook.add_embed(embed2)
webhook.execute()
print()
sprint(f"Failed to Boost https://discord.gg/{invite}, {amount} times for {months} months. Operation took {time_taken} seconds", False)
print()
webhook = DiscordWebhook(url=config["boost_failed_log_webhook"])
with open("success.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='success.txt')
with open("failed.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='failed.txt')
webhook.execute()
os.remove("success.txt")
os.remove("failed.txt")
elif boosted:
with open('success.txt', 'w') as f:
for line in variables.success_tokens:
f.write(f"{line}\n")
with open('failed.txt', 'w') as g:
for line in variables.failed_tokens:
g.write(f"{line}\n")
embed3 = DiscordEmbed(title = "**Boosts Successful**", description = f"**Boost Type: **Automatic\n**Order ID: **{order_id}\n**Product Name: **{product_name}\n**Customer Email: **{customer_email}\n\n**Invite Link: **https://discord.gg/{invite}\n**Amount: **{amount} Boosts\n**Months: **{months} Months\n\n**Time Taken: **{time_taken} seconds\n**Successful Tokens: **{len(variables.success_tokens)}\n**Successful Boosts: **{len(variables.success_tokens)*2}\n\n**Failed Tokens: **{len(variables.failed_tokens)}\n**Failed Boosts: **{len(variables.failed_tokens)*2}", color = '4598d2')
embed3.set_timestamp()
webhook = DiscordWebhook(url=config["boost_log_webhook"])
webhook.add_embed(embed3)
webhook.execute()
print()
sprint(f"Boosted https://discord.gg/{invite}, {amount} times for {months} months. Operation took {time_taken} seconds", True)
print()
webhook = DiscordWebhook(url=config["boost_log_webhook"])
with open("success.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='success.txt')
with open("failed.txt", "rb") as f:
webhook.add_file(file=f.read(), filename='failed.txt')
webhook.execute()
os.remove("success.txt")
os.remove("failed.txt")
except Exception as e:
#sprint(f"{e} | Function: Start_Sellapp", False)
pass
def run():
app.run(host="0.0.0.0", port="6969")
def keep_alive():
t = Thread(target=run)
t.start()