-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbalance.py
More file actions
94 lines (83 loc) · 3.21 KB
/
balance.py
File metadata and controls
94 lines (83 loc) · 3.21 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
import requests
import csv
import time
import json
import ctypes
import threading
import tls_client
from utils import log,log_error,log_error_p,log_info,log_success
cookies=[]
proxies = []
with open('accounts.csv','r') as file:
acc = csv.reader(file)
header = next(acc)
if header != None:
for lines in acc:
cookies.append(lines[0])
proxies.append(lines[1])
with open("settings.json",'r',encoding='UTF-8') as file:
FileData = json.load(file)
CaptchaKey = FileData['UserData']['2capKey']
UserAgent = FileData['UserData']['UserAgent']
WebhookUrl = FileData['UserData']['WebhookUrl']
MinimumDelay = FileData['UserData']['MinimumDelay']
MaximumDelay = FileData['UserData']['MaximumDelay']
success = 0
errors = 0
def updatebar(Xsuccess,Xerrors):
global success
global errors
success += Xsuccess
errors += Xerrors
def time_elapsed():
start_time = time.time()
while True:
elapsed_time = time.time() - start_time
hours, rem = divmod(elapsed_time, 3600)
minutes, seconds = divmod(rem, 60)
elapsed_time_str = "{:0>2}:{:0>2}:{:0>2}".format(int(hours), int(minutes), int(seconds))
ctypes.windll.kernel32.SetConsoleTitleW(f"KeyDrop Balance by Rafał#6750 | Accounts: {len(cookies)} | Success: {success} Errors: {errors} | Time Elapsed: {elapsed_time_str}")
time.sleep(1)
def SwitchString(proxy):
if proxy == "x":
proxy = ""
return proxy
else:
proxy_ditails = proxy.split(":")
pelneproxy = proxy_ditails[2]+":"+proxy_ditails[3]+"@"+proxy_ditails[0]+":"+proxy_ditails[1]
proxies = {
'http': 'http://'+pelneproxy,
'https': 'http://'+pelneproxy}
return proxies
def balance():
threading.Thread(target=time_elapsed).start()
total_value = 0
while True:
try:
for task in range(len(cookies)):
session = tls_client.Session( client_identifier="chrome_112" )
cookie = cookies[task]
headers = {
'authority': 'key-drop.com',
'accept-language': 'pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7',
'User-Agent': UserAgent,
'Cookie': cookie,
}
balance_req = session.get('https://key-drop.com/pl/panel/profil/eq_value', headers=headers,proxy=SwitchString(proxies[task]))
if balance_req.status_code == 200:
account_eq_value = balance_req.json()['fullPrice']
log_success(f"[{task}] Eq Value: {account_eq_value}")
updatebar(1,0)
total_value+=float(account_eq_value)
else:
updatebar(0,1)
log_error_p(balance_req.status_code)
log_success(f"Accounts: {len(cookies)} | Total eq value: {round(total_value,2)} PLN")
break
except Exception as er:
if "Proxy responded with non 200 code: 407" in str(er):
log_error_p(f"[{task}] Connection error, waiting 5s")
time.sleep(5)
continue
else:
log_error_p(str(er))