-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfi.py
338 lines (310 loc) · 14.6 KB
/
cfi.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
import requests
import datetime
import time
from colorama import init, Fore, Style
import sys
import os
init(autoreset=True)
def print_welcome_message():
print(r"""
█ █ █ █ ▄▄▄▄▄ █ █ ▄▄▄▄▄
█ ▀ ▀ █ █ █ █ ▄▄█ █ █ █▄▄▄█
█ ▀ █ █▄▄█ █ ▄ █▄▄█ █
""")
print(Fore.GREEN + Style.BRIGHT + "Cyberfinance BOT")
print(Fore.GREEN + Style.BRIGHT + "Update Link: https://github.com/frisca30/")
print(Fore.YELLOW + Style.BRIGHT + "Free Konsultasi Join Discord: https://discord.gg/ikuzodao")
print(Fore.BLUE + Style.BRIGHT + "Belikan saya kopi :) 0881 0260 1020 05 DANA")
print(Fore.RED + Style.BRIGHT + "gausah mbok jual ! Ngotak dikit bos. Ngoding susah2 kau tinggal rename :)\n\n")
def clear_console():
os.system('cls' if os.name == 'nt' else 'clear')
def fetch_access_token(init_data):
url = "https://api.cyberfin.xyz/api/v1/game/initdata"
headers = {
'accept': 'application/json',
'accept-language': 'en-US,en;q=0.9',
'cache-control': 'no-cache',
'content-type': 'application/json',
'origin': 'https://g.cyberfin.xyz',
'pragma': 'no-cache',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Linux; Android 10; SM-G973F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36'
}
data = f'{{"initData":"{init_data}"}}'
response = requests.post(url, headers=headers, data=data)
# print(response.json())
if response.status_code == 201:
return response.json()['message']['accessToken']
else:
print("Failed to fetch access token")
return None
def read_tokens():
with open('initdata.txt', 'r') as file:
return [line.strip() for line in file if line.strip()]
def info_balance(ini_token):
url = "https://api.cyberfin.xyz/api/v1/game/mining/gamedata"
headers = {
'accept': 'application/json',
'accept-language': 'en-ID,en-US;q=0.9,en;q=0.8,id;q=0.7',
'authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'dnt': '1',
'if-none-match': 'W/"173-kqxt3jfCFv2BCBRPJM7mhgWVfbI"',
'origin': 'https://g.cyberfin.xyz',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
}
response = requests.get(url, headers=headers)
data = response.json()
crack_time = data['message']['miningData']['crackTime']
now = datetime.datetime.now().timestamp()
countdown = crack_time - now
hours, remainder = divmod(countdown, 3600)
minutes, seconds = divmod(remainder, 60)
print(f"{Fore.BLUE+Style.BRIGHT}[ Cracking ]:", f"{Fore.BLUE+Style.BRIGHT}{int(hours):02} Jam {int(minutes):02} Menit", f"{Fore.BLUE+Style.BRIGHT}lagi untuk claim")
def claim_mining(ini_token):
url = "https://api.cyberfin.xyz/api/v1/mining/claim"
headers = {
'accept': 'application/json',
'accept-language': 'en-ID,en-US;q=0.9,en;q=0.8,id;q=0.7',
'authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'dnt': '1',
'if-none-match': 'W/"173-kqxt3jfCFv2BCBRPJM7mhgWVfbI"',
'origin': 'https://g.cyberfin.xyz',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
}
response = requests.get(url, headers=headers)
data = response.json()
print(f"{Fore.YELLOW+Style.BRIGHT}[ Claim ]: {data['message']}")
def auto_upgrade_hammer(ini_token, max_level):
url = "https://api.cyberfin.xyz/api/v1/mining/boost/apply"
headers = {
'accept': 'application/json',
'accept-language': 'en-ID,en-US;q=0.9,en;q=0.8,id;q=0.7',
'authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'content-type': 'application/json',
'dnt': '1',
'origin': 'https://g.cyberfin.xyz',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
}
data = '{"boostType":"HAMMER"}'
while True:
response = requests.post(url, headers=headers, data=data)
if response.status_code != 201:
sys.stdout.write(f"{Fore.RED+Style.BRIGHT}[ Hammer ]: Saldo tidak cukup\n")
break
response_data = response.json()
current_level = response_data['message']['boostData']['hammerLevel']
sys.stdout.write(f"\r{Fore.GREEN+Style.BRIGHT}[ Hammer ] Sukses Upgrade. Level: {current_level}")
if current_level >= max_level:
sys.stdout.write(f"\n{Fore.GREEN+Style.BRIGHT}[ Hammer ] Already at level {current_level}\n")
break
def auto_upgrade_egg(ini_token, max_level):
url = "https://api.cyberfin.xyz/api/v1/mining/boost/apply"
headers = {
'accept': 'application/json',
'accept-language': 'en-ID,en-US;q=0.9,en;q=0.8,id;q=0.7',
'authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'content-type': 'application/json',
'dnt': '1',
'origin': 'https://g.cyberfin.xyz',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
}
data = '{"boostType":"EGG"}'
while True:
response = requests.post(url, headers=headers, data=data)
if response.status_code != 201:
sys.stdout.write(f"{Fore.RED+Style.BRIGHT}[ Egg Level ]: Saldo tidak cukup\n")
break
response_data = response.json()
current_level = response_data['message']['boostData']['eggLevel']
sys.stdout.write(f"\r{Fore.GREEN+Style.BRIGHT}[ Egg Level ] Sukses Upgrade. Level: {current_level}")
if current_level >= max_level:
sys.stdout.write(f"\n{Fore.GREEN+Style.BRIGHT}[ Egg Level ] Already at level {current_level}\n")
break
def fetch_uuids(ini_token):
url = "https://api.cyberfin.xyz/api/v1/gametask/all"
headers = {
'Authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'accept': 'application/json',
'accept-language': 'en-ID,en-US;q=0.9,en;q=0.8,id;q=0.7',
'dnt': '1',
'if-none-match': 'W/"173-kqxt3jfCFv2BCBRPJM7mhgWVfbI"',
'origin': 'https://g.cyberfin.xyz',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
}
response = requests.get(url, headers=headers)
# print(response.json())
if response.status_code == 200:
tasks = response.json()['message']
return [(task['uuid'], task['description']) for task in tasks if not task['isCompleted']]
else:
print("Failed to fetch tasks")
return []
def complete_tasks(uuids, ini_token):
base_url = "https://api.cyberfin.xyz/api/v1/gametask/complete/"
headers = {
'Authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'Content-Type': 'application/json'
}
for uuid, description in uuids:
response = requests.patch(f"{base_url}{uuid}", headers=headers)
response_data = response.json()
if response.status_code == 200:
print(f"{Fore.GREEN+Style.BRIGHT}[ Task ]: {description} Completed")
else:
print(f"{Fore.RED+Style.BRIGHT}[ Task ]: {description} Gagal. {response_data['message']}")
def user_level(ini_token):
url = "https://api.cyberfin.xyz/api/v1/mining/boost/info"
headers = {
'accept': 'application/json',
'accept-language': 'en-ID,en-US;q=0.9,en;q=0.8,id;q=0.7',
'authorization': f'Bearer {ini_token}', # Menggunakan token yang dibaca
'dnt': '1',
'if-none-match': 'W/"a4-LZ8zXP3aEql/rLf1iujkfLlL6Tk"',
'origin': 'https://g.cyberfin.xyz',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()['message']
return data
else:
print(f"{Fore.RED+Style.BRIGHT}[ Gagal mendapatkan informasi level pengguna ]")
def get_mining_info(ini_token):
url = "https://api.cyberfin.xyz/api/v1/game/mining/gamedata"
headers = {
'accept': 'application/json',
'accept-language': 'en-US,en;q=0.9',
'authorization': f'Bearer {ini_token}',
'cache-control': 'no-cache',
'origin': 'https://g.cyberfin.xyz',
'pragma': 'no-cache',
'priority': 'u=1, i',
'referer': 'https://g.cyberfin.xyz/',
'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Microsoft Edge";v="126", "Microsoft Edge WebView2";v="126"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'secret-key': 'cyberfinance',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()['message']
balance = int(data['userData']['balance'])
mining_rate = data['miningData']['miningRate']
now = datetime.datetime.now().timestamp()
print(f"{Fore.YELLOW+Style.BRIGHT}[ Balance ]: {balance:,}")
print(f"{Fore.YELLOW+Style.BRIGHT}[ Minning Rate ]: {mining_rate}")
else:
print(f"{Fore.RED+Style.BRIGHT}[ Gagal mendapatkan informasi mining ]")
def main():
print_welcome_message()
user_input_task = input("Auto cleartask ? (y / n) : ")
user_input_hammer = input("Auto upgrade hammer ( Cracking Power ) ? (y / n) : ")
if user_input_hammer == 'y':
max_hammer_level = int(input("Max Upgrade Until Level? : "))
user_input_egg = input("Auto upgrade egg ( Jam per Claim ) ? (y / n) : ")
if user_input_egg == 'y':
max_egg_level = int(input("Max Upgrade Until Level? : "))
clear_console()
while True:
print_welcome_message()
tokens = read_tokens() # Membaca semua token dari file
for index, init_data in enumerate(tokens):
ini_token = fetch_access_token(init_data)
if not ini_token:
continue
print(f"{Fore.CYAN+Style.BRIGHT}============== [ Akun ke-{index + 1} ] ==============") # Mencetak nama
get_mining_info(ini_token) # Get and display mining info
datauser = user_level(ini_token)
if datauser:
level_hammer = int(datauser['hammerLevel'])
level_egg = int(datauser['eggLevel'])
print(f"{Fore.BLUE+Style.BRIGHT}[ Egg Level ]: {level_hammer}")
print(f"{Fore.BLUE+Style.BRIGHT}[ Hammer Level ]: {level_egg}")
if user_input_hammer.lower() == 'y':
if level_hammer >= max_hammer_level:
print(f"{Fore.RED+Style.BRIGHT}[ Hammer Level ]: Already at level {level_hammer} ")
else:
auto_upgrade_hammer(ini_token, max_hammer_level)
if user_input_egg.lower() == 'y':
if level_egg >= max_egg_level:
print(f"{Fore.RED+Style.BRIGHT}[ Egg Level ]: Already at level {level_egg} ")
else:
auto_upgrade_egg(ini_token, max_egg_level)
if user_input_task.lower() == 'y':
uuids = fetch_uuids(ini_token)
complete_tasks(uuids, ini_token)
info_balance(ini_token)
claim_mining(ini_token)
for i in range(3600, 0, -1):
sys.stdout.write(f"\r{Fore.CYAN+Style.BRIGHT}============ Selesai, tunggu {i} detik.. ============")
sys.stdout.flush()
time.sleep(1)
print() # Cetak baris baru setelah hitungan mundur selesai
# Membersihkan konsol setelah hitungan mundur
clear_console()
time.sleep(5) # Delay 5 detik sebelum memulai lagi
if __name__ == "__main__":
main()