-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbot.py
232 lines (202 loc) · 8.84 KB
/
bot.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
import time
import requests
import random
import urllib.parse
import os
import signal
from colorama import Fore, Style, init
from datetime import datetime
# Initialize colorama for color output
init(autoreset=True)
# Global variable to control the main loop
running = True
def signal_handler(signum, frame):
global running
running = False
print(Fore.LIGHTBLACK_EX + f"\n[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.YELLOW + "Received interrupt signal. Preparing to exit...")
# Register the signal handler
signal.signal(signal.SIGINT, signal_handler)
def clear_terminal():
os.system('cls' if os.name == 'nt' else 'clear')
def art(total_accounts):
print(Fore.GREEN + Style.BRIGHT + r"""
___ _ __ __ _ _
/ _ \ _ _ _ _ _ _ ___| |__ | \/ |__ _| |_ _ __ _ _ __| |
| (_) | '_| '_| ' \/ _ \ '_ \ | |\/| / _` | ' \| ' \ || / _` |
\___/|_| |_| |_||_\___/_.__/ |_| |_\__,_|_||_|_|_|_\_,_\__,_|
Auto Claim Bot For XkuCoin - Orrnob's Drop Automation
Author : Orrnob Mahmud
Github : https://github.com/OrrnobMahmud
Telegram: https://t.me/verifiedcryptoairdops
""" + Style.RESET_ALL)
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] Total accounts: {total_accounts}")
print(Fore.YELLOW + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
def read_data_file(file_path):
accounts = []
with open(file_path, "r") as file:
lines = file.readlines()
for line in lines:
encoded_data = line.strip()
if encoded_data:
accounts.append(encoded_data)
return accounts
def decode_data(encoded_data):
params = dict(item.split('=') for item in encoded_data.split('&'))
decoded_user = urllib.parse.unquote(params['user'])
decoded_start_param = urllib.parse.unquote(params['start_param'])
return {
"decoded_user": decoded_user,
"decoded_start_param": decoded_start_param,
"hash": params['hash'],
"auth_date": params['auth_date'],
"chat_type": params['chat_type'],
"chat_instance": params['chat_instance']
}
def login(decoded_data):
url = "https://www.kucoin.com/_api/xkucoin/platform-telebot/game/login?lang=en_US"
headers = {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
"sec-ch-ua": "\"Chromium\";v=\"111\", \"Not(A:Brand\";v=\"8\"",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": "\"Android\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-request-with": "null",
"Referer": "https://www.kucoin.com/miniapp/tap-game?inviterUserId=5496274031&rcode=QBSTAPN3"
}
body = {
"inviterUserId": "5496274031",
"extInfo": {
"hash": decoded_data['hash'],
"auth_date": decoded_data['auth_date'],
"via": "miniApp",
"user": decoded_data['decoded_user'],
"chat_type": decoded_data['chat_type'],
"chat_instance": decoded_data['chat_instance'],
"start_param": decoded_data['decoded_start_param']
}
}
session = requests.Session()
response = session.post(url, headers=headers, json=body)
cookie = '; '.join([f"{cookie.name}={cookie.value}" for cookie in session.cookies])
return cookie
def data(cookie):
url = "https://www.kucoin.com/_api/xkucoin/platform-telebot/game/summary?lang=en_US"
headers = {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
"sec-ch-ua": "\"Chromium\";v=\"111\", \"Not(A:Brand\";v=\"8\"",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": "\"Android\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-request-with": "null",
"Referer": "https://www.kucoin.com/miniapp/tap-game?inviterUserId=5496274031&rcode=QBSTAPN3",
"cookie": cookie
}
response = requests.get(url, headers=headers)
data = response.json()
balance = data.get("data", {}).get("availableAmount")
molecule = data.get("data", {}).get("feedPreview", {}).get("molecule")
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.GREEN + f"Balance: " + Fore.WHITE + f"{balance}")
return molecule
def tap(cookie, molecule):
url = "https://www.kucoin.com/_api/xkucoin/platform-telebot/game/gold/increase?lang=en_US"
headers = {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/x-www-form-urlencoded",
"sec-ch-ua": "\"Chromium\";v=\"111\", \"Not(A:Brand\";v=\"8\"",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": "\"Android\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-request-with": "null",
"Referer": "https://www.kucoin.com/miniapp/tap-game?inviterUserId=5496274031&rcode=QBSTAPN3",
"cookie": cookie
}
total_increment = 0
while total_increment < 3000 and running:
increment = random.randint(55, 60)
form_data = {
'increment': str(increment),
'molecule': str(molecule)
}
try:
response = requests.post(url, headers=headers, data=form_data)
total_increment += increment
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.GREEN + f"Tapped: " + Fore.WHITE + f"{increment} | " +
Fore.GREEN + f"Total Tap: " + Fore.WHITE + f"{total_increment}/3000")
time.sleep(2)
except requests.exceptions.RequestException:
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.RED + "Network error occurred. Retrying...")
time.sleep(5)
def new_balance(cookie):
url = "https://www.kucoin.com/_api/xkucoin/platform-telebot/game/summary?lang=en_US"
headers = {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
"sec-ch-ua": "\"Chromium\";v=\"111\", \"Not(A:Brand\";v=\"8\"",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": "\"Android\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-request-with": "null",
"Referer": "https://www.kucoin.com/miniapp/tap-game?inviterUserId=5496274031&rcode=QBSTAPN3",
"cookie": cookie
}
response = requests.get(url, headers=headers)
data = response.json()
balance = data.get("data", {}).get("availableAmount")
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.GREEN + f"New Balance: " + Fore.WHITE + f"{balance}")
def main():
global running
file_path = "data.txt"
encoded_data_list = read_data_file(file_path)
total_accounts = len(encoded_data_list)
try:
while running:
clear_terminal()
art(total_accounts)
for index, encoded_data in enumerate(encoded_data_list, start=1):
if not running:
break
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.GREEN + f"Processing Account No.{index}")
try:
decoded_data = decode_data(encoded_data)
cookie = login(decoded_data)
molecule = data(cookie)
tap(cookie, molecule)
new_balance(cookie)
except Exception as e:
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.RED + f"Error processing account {index}: {str(e)}")
if running:
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.YELLOW + "Waiting for 2 minutes before next cycle...")
for _ in range(120):
if not running:
break
time.sleep(1)
except Exception as e:
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.RED + f"An unexpected error occurred: {str(e)}")
finally:
print(Fore.LIGHTBLACK_EX + f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] " +
Fore.GREEN + "Successfully logged out from bot. Goodbye!")
if __name__ == "__main__":
main()