This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
279 lines (215 loc) · 10.8 KB
/
app.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
274
275
276
277
278
279
import http.client
import mimetypes
import sys
import time
import math
import random
import os
import requests
import simplejson
import keyboard
import colorama
from colorama import Fore, Back, Style
API_KEY = str("KEY")
colorama.init(autoreset=True)
def askUser():
print(Fore.CYAN + Style.BRIGHT + '''
.d8888b. 888 8888888b. d8b
d88P Y88b 888 888 Y88b Y8P
Y88b. 888 888 888
"Y888b. 88888b. .d88b. .d88b. .d88888 888 d88P 888d888 .d88b. 888 888 888 .d88b. .d8888b
"Y88b. 888 "88b d8P Y8b d8P Y8b d88" 888 8888888P" 888P" d88""88b `Y8bd8P' 888 d8P Y8b 88K
"888 888 888 88888888 88888888 888 888 888 888 888 888 X88K 888 88888888 "Y8888b.
Y88b d88P 888 d88P Y8b. Y8b. Y88b 888 888 888 Y88..88P .d8""8b. 888 Y8b. X88
"Y8888P" 88888P" "Y8888 "Y8888 "Y88888 888 888 "Y88P" 888 888 888 "Y8888 88888P'
888
888
888
''')
url = "https://speedproxies.net/"
page = requests.get(url)
pageStatus = page.status_code
if pageStatus == 200:
sys.stdout.write(Fore.WHITE + Style.BRIGHT + '\rAPI Status:' + Fore.GREEN + ' Online\n')
else:
print(Fore.RED + "API HTTP Error Status: " + str(pageStatus))
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "1" + Fore.WHITE + Style.BRIGHT + "] Create new user")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "2" + Fore.WHITE + Style.BRIGHT + "] Add bandwidth to user")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "3" + Fore.WHITE + Style.BRIGHT + "] Check user balance")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "4" + Fore.WHITE + Style.BRIGHT + "] Remove bandwidth from user")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "5" + Fore.WHITE + Style.BRIGHT + "] Proxy Generator")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "6" + Fore.WHITE + Style.BRIGHT + "] Quit\n")
taskAsk = input(Fore.WHITE + Style.BRIGHT)
if taskAsk == "1":
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Create user]")
userInput = input(Fore.WHITE + Style.BRIGHT + "Username: ").lower()
if userInput!= "":
taskCreate(userCreate=userInput)
elif taskAsk == "2":
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Add bandwidth to user]")
userInput = (input(Fore.WHITE + Style.BRIGHT + "Username: ")).lower()
bandInput = float(input(Fore.WHITE + Style.BRIGHT + "Bandwidth (GB): "))
if userInput!= "" and bandInput!= "":
taskAddBand(userInput=userInput, bandInput=bandInput)
elif taskAsk == "3":
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Check bandwidth of user]")
userInput = input(Fore.WHITE + Style.BRIGHT + "Username: ").lower()
if userInput!= "":
taskCheckBal(userInput=userInput)
elif taskAsk == "4":
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Delete bandwidth from user]")
userInput = (input(Fore.WHITE + Style.BRIGHT + "Username: ")).lower()
bandInput = float(input(Fore.WHITE + Style.BRIGHT + "Bandwidth (GB): "))
if userInput!= "" and bandInput!= "":
taskDeleteBand(userInput=userInput, bandInput=bandInput)
elif taskAsk == "5":
clear()
userInput = input(Fore.WHITE + Style.BRIGHT + "Username: ").lower()
ssl = "http"
hostname = "ip"
country = (input(Fore.WHITE + Style.BRIGHT + "Country: "))
sticky = (input(Fore.WHITE + Style.BRIGHT + "Sticky/Randomize: ")).lower()
quantity = input(Fore.WHITE + Style.BRIGHT + "List Size [10/100/1000]: ")
print(Fore.WHITE + Style.BRIGHT + "Format:")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "1" + Fore.WHITE + Style.BRIGHT + "] username:password:hostname:port")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "2" + Fore.WHITE + Style.BRIGHT + "] hostname:port:username:password")
print(Fore.WHITE + Style.BRIGHT + "[" + Fore.CYAN + Style.BRIGHT + "3" + Fore.WHITE + Style.BRIGHT + "] hostname:port@username:password")
format_input = int(input(Fore.WHITE + Style.BRIGHT))
if format_input == 1:
format = "username:password:hostname:port"
elif format_input == 2:
format = "hostname:port:username:password"
elif format_input == 3:
format = "hostname:port@username:password"
else:
format = "username:password:hostname:port"
taskGen(userInput=userInput, country=country, hostname=hostname, ssl=ssl, sticky=sticky, format=format, quantity=quantity)
elif taskAsk == "5":
print(Fore.WHITE + Style.BRIGHT + "Quiting")
else:
print(Fore.WHITE + Style.BRIGHT + "Task non existent")
def taskCreate(userCreate):
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Create user]")
print(Fore.WHITE + Style.BRIGHT + "Username: " +userCreate)
url = "https://dash.speedproxies.net/api/standard-resi/create-user"
payload = '{"username":"' + str(userCreate) + '"}'
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
jsonResponse = response.json()
createdUser = jsonResponse["data"]["username"]
createdPassword = jsonResponse["data"]["proxy_authkey"]
createdStatus = jsonResponse["status"]
createdMessage = jsonResponse["message"]
if response == 200:
print(Fore.WHITE + Style.BRIGHT + "Proxy Username: " + str(createdUser))
print(Fore.WHITE + Style.BRIGHT + "Proxy Password: " + str(createdPassword))
else:
print(Fore.WHITE + Style.BRIGHT + "Error Creating Username: (Status " + str(createdStatus) +") " + str(createdMessage))
main_screen = str(input(Fore.WHITE + Style.BRIGHT + "\nFinished (yes)? \n")).lower()
if main_screen == "yes":
os.system('cls')
askUser()
def taskAddBand(userInput, bandInput):
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Add bandwidth to user]")
print(Fore.WHITE + Style.BRIGHT + "Username: " + userInput)
print(Fore.WHITE + Style.BRIGHT + "Bandwidth (GB): " + str(bandInput))
addBand = float(bandInput * 100)
url = "https://dash.speedproxies.net/api/standard-resi/give-balance"
payload = '{"username":"' + str(userInput) + '","bandwidth":"' + str(addBand) + '"}'
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
jsonResponse = response.json()
bandBalance = jsonResponse["data"]["balance"]
calcBand = float(bandBalance / 100)
userDB = jsonResponse["data"]["username"]
print(Fore.WHITE + Style.BRIGHT + "Proxy Username: " + str(userDB))
print(Fore.WHITE + Style.BRIGHT + "Bandwidth Added: " + str(bandInput) + "GB")
print(Fore.WHITE + Style.BRIGHT + "Bandwidth Remaining: " + str(calcBand) + "GB \n")
main_screen = str(input(Fore.WHITE + Style.BRIGHT + "\nFinished (yes)? \n")).lower()
if main_screen == "yes":
os.system('cls')
askUser()
def taskDeleteBand(userInput, bandInput):
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Delete bandwidth from user]")
print(Fore.WHITE + Style.BRIGHT + "Username: " +userInput)
print(Fore.WHITE + Style.BRIGHT + "Bandwidth (GB): " + str(bandInput))
addBand = (bandInput * 100)
url = "https://dash.speedproxies.net/api/standard-resi/remove-balance"
payload = '{"username":"' + str(userInput) + '","bandwidth":"' + str(addBand) + '"}'
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
jsonResponse = response.json()
bandBalance = jsonResponse["data"]["balance"]
calcBand = float(bandBalance / 100)
userDB = jsonResponse["data"]["username"]
print(Fore.WHITE + Style.BRIGHT + "Proxy Username: " + str(userDB))
print(Fore.WHITE + Style.BRIGHT + "Bandwidth Removed: " + str(bandInput) + "GB")
print(Fore.WHITE + Style.BRIGHT + "Bandwidth Remaining: " + str(calcBand) + "GB \n")
main_screen = str(input(Fore.WHITE + Style.BRIGHT + "\nFinished (yes)? \n")).lower()
if main_screen == "yes":
os.system('cls')
askUser()
def taskCheckBal(userInput):
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Check bandwidth of user]")
print(Fore.WHITE + Style.BRIGHT + "Username: " +userInput)
url = "https://dash.speedproxies.net/api/standard-resi/user-info"
payload = '{"username":"' + str(userInput) + '"}'
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
jsonResponse = response.json()
bandBalance = jsonResponse["data"]["balance"]
calcBand = float(bandBalance / 100)
userDB = jsonResponse["data"]["username"]
print(Fore.WHITE + Style.BRIGHT + "Proxy Username: " + str(userDB))
print(Fore.WHITE + Style.BRIGHT + "Bandwidth Remaining: " + str(calcBand) + "GB \n")
main_screen = str(input(Fore.WHITE + Style.BRIGHT + "\nFinished (yes)? \n")).lower()
if main_screen == "yes":
os.system('cls')
askUser()
def taskGen(userInput, country, hostname, ssl, sticky, format, quantity):
clear()
print(Fore.WHITE + Style.BRIGHT + "\n[Generate Proxy List]")
print(Fore.WHITE + Style.BRIGHT + "Username: " +userInput)
print(Fore.WHITE + Style.BRIGHT + "Country: " +country)
print(Fore.WHITE + Style.BRIGHT + "Mode: " +sticky)
print(Fore.WHITE + Style.BRIGHT + "Format: " +format)
print(Fore.WHITE + Style.BRIGHT + "Quantity: " +quantity)
url = "https://dash.speedproxies.net/api/standard-resi/view-proxylist"
payload = '{"username":"' + str(userInput) + '","country":"' + str(country) + '","hostname":"' + str(hostname) + '","ssl":"' + str(ssl) + '","sticky":"' + str(sticky) + '","format":"' + str(format) + '","quantity":"' + str(quantity) + '"}'
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
jsonResponse = response.json()
proxylist = jsonResponse["data"]["formatted_proxy_list"]
print("\n")
for x in proxylist:
print(Fore.WHITE + Style.BRIGHT + x)
main_screen = str(input(Fore.WHITE + Style.BRIGHT + "\nFinished (yes)? \n")).lower()
if main_screen == "yes":
os.system('cls')
askUser()
def clear():
os.system( 'cls' )
askUser()