-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbot.py
More file actions
297 lines (261 loc) · 13.1 KB
/
bot.py
File metadata and controls
297 lines (261 loc) · 13.1 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
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
import requests
import json
import os
from colorama import *
from datetime import datetime, timedelta, timezone
from core.helper import get_headers, countdown_timer, extract_user_data, config
import random
import time
from platform import system as s_name
from os import system as sys
class MoneyDOGS:
def __init__(self):
self.headers = None
self.session = requests.Session()
def clear_terminal(self):
os.system('cls' if os.name == 'nt' else 'clear')
def log(self, message):
print(
f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().strftime('%x %X %Z')} ]{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}{message}",
flush=True
)
def welcome(self):
banner = f"""{Fore.GREEN}
██████ ██ ██ ██████ ██ ██ ███ ███ ██████ ███████ ██████
██ ██ ██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ████ ██ ██████ █████ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██████ ██████ ██████ ██ ██ ██████ ███████ ██ ██
"""
print(Fore.GREEN + Style.BRIGHT + banner + Style.RESET_ALL)
print(Fore.GREEN + f" Money Dogs")
print(Fore.RED + f" FREE TO USE = Join us on {Fore.GREEN}t.me/cucumber_scripts")
print(Fore.YELLOW + f" before start please '{Fore.GREEN}git pull{Fore.YELLOW}' to update bot")
print(f"{Fore.WHITE}~" * 60)
def set_proxy(self, proxy):
self.session.proxies = {
"http": proxy,
"https": proxy,
}
if '@' in proxy:
host_port = proxy.split('@')[-1]
else:
host_port = proxy.split('//')[-1]
return host_port
def format_seconds(self, seconds):
hours, remainder = divmod(seconds, 3600)
minutes, seconds = divmod(remainder, 60)
return f"{int(hours):02}:{int(minutes):02}:{int(seconds):02}"
def get(self, id):
tokens = json.loads(open("tokens.json").read())
if str(id) not in tokens.keys():
return None
return tokens[str(id)]
def get_token(self, query: str):
url = 'https://api.moneydogs-ton.com/sessions'
data = json.dumps({'encodedMessage': query, 'retentionCode': '48cdRxLi'})
self.headers.update({
'Content-Length': str(len(data)),
'Content-Type': 'application/json'
})
response = self.session.post(url, headers=self.headers, data=data)
data = response.json()
if response.status_code == 200:
return data['token']
else:
return None
def user_info(self, token: str):
url = 'https://api.moneydogs-ton.com/mdogs-deposits'
self.headers.update({
'Content-Length': '0',
'Content-Type': 'application/json',
'X-Auth-Token': token
})
response = self.session.get(url, headers=self.headers)
data = response.json()
if response.status_code == 200:
return data
else:
return None
def daily_checkin(self, token: str):
url = 'https://api.moneydogs-ton.com/daily-check-in'
self.headers.update({
'Content-Length': '0',
'Content-Type': 'application/json',
'X-Auth-Token': token
})
response = self.session.post(url, headers=self.headers)
data = response.json()
if response.status_code == 200:
return data
else:
return None
def get_tasks(self, token: str, task_type: str = 'all'):
base_url = 'https://api.moneydogs-ton.com/tasks'
url = f"{base_url}?isFeatured=true" if task_type == 'featured' else base_url
self.headers.update({
'Content-Length': '0',
'Content-Type': 'application/json',
'X-Auth-Token': token
})
response = self.session.get(url, headers=self.headers)
data = response.json()
if response.status_code == 200:
return data
else:
return None
def complete_tasks(self, token: str, task_id: str):
url = f'https://api.moneydogs-ton.com/tasks/{task_id}/verify'
self.headers.update({
'Content-Type': 'application/json',
'X-Auth-Token': token
})
response = self.session.post(url, headers=self.headers)
if response.status_code in [200, 201]:
return True
else:
return None
def process_query(self, query: str):
token = self.get_token(query)
if not token:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Account{Style.RESET_ALL}"
f"{Fore.RED + Style.BRIGHT} Query ID Isn't Valid {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
return
if token:
user = self.user_info(token)
if user:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Account{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {user['user']['firstName']} {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}] [ Balance{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {user['remainingAmount']:.4f} $MDOGS {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
time.sleep(1)
checkin = self.daily_checkin(token)
if checkin:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Check-in{Style.RESET_ALL}"
f"{Fore.GREEN + Style.BRIGHT} Is Claimed {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}] [ Reward{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {checkin['rewardMdogs']} $MDOGS {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
else:
now = datetime.now(timezone.utc)
checkin_time = (now + timedelta(days=1)).replace(hour=0, minute=0, second=0,
microsecond=0).strftime('%x %X %Z')
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Check-in{Style.RESET_ALL}"
f"{Fore.YELLOW + Style.BRIGHT} Not Time to Claim {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}] [ Next Claim at{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {checkin_time} {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
time.sleep(1)
for type in ['featured', 'all']:
tasks = self.get_tasks(token, type)
if tasks:
for task in tasks:
task_id = str(task['id'])
if task:
verify = self.complete_tasks(token, task_id)
if verify:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Tasks{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {task['title']} {Style.RESET_ALL}"
f"{Fore.GREEN + Style.BRIGHT}Is Completed{Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT} ] [ Reward{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {task['rewardMdogs']:.1f} $MDOGS {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
else:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Tasks{Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT} {task['title']} {Style.RESET_ALL}"
f"{Fore.RED + Style.BRIGHT}Isn't Completed{Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT} ]{Style.RESET_ALL}"
)
time.sleep(1)
else:
if tasks == 'featured':
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Partner Tasks{Style.RESET_ALL}"
f"{Fore.GREEN + Style.BRIGHT} Is Completed {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
else:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ General Tasks{Style.RESET_ALL}"
f"{Fore.GREEN + Style.BRIGHT} Is Completed {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
else:
self.log(
f"{Fore.MAGENTA + Style.BRIGHT}[ Account{Style.RESET_ALL}"
f"{Fore.RED + Style.BRIGHT} Data Is None {Style.RESET_ALL}"
f"{Fore.MAGENTA + Style.BRIGHT}]{Style.RESET_ALL}"
)
def main(self):
try:
with open('query.txt', 'r') as file:
queries = [line.strip() for line in file if line.strip()]
with open('proxies.txt', 'r') as file:
proxies = [line.strip() for line in file if line.strip()]
while True:
self.log(
f"{Fore.GREEN + Style.BRIGHT}Account's Total: {Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT}{len(queries)}{Style.RESET_ALL}"
)
self.log(
f"{Fore.GREEN + Style.BRIGHT}Proxy's Total: {Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT}{len(proxies)}{Style.RESET_ALL}"
)
self.log(f"{Fore.CYAN + Style.BRIGHT}-----------------------------------------------------------------------{Style.RESET_ALL}")
for i, query in enumerate(queries):
query = query.strip()
if query:
self.log(
f"{Fore.GREEN + Style.BRIGHT}Account: {Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT}{i+1} / {len(queries)}{Style.RESET_ALL}"
)
if len(proxies) >= len(queries):
proxy = self.set_proxy(proxies[i])# Set proxy for each account
self.log(
f"{Fore.GREEN + Style.BRIGHT}Use proxy: {Style.RESET_ALL}"
f"{Fore.WHITE + Style.BRIGHT}{proxy}{Style.RESET_ALL}"
)
else:
self.log(Fore.RED + "Number of proxies is less than the number of accounts. Proxies are not used!")
print(f"{Fore.YELLOW + Style.BRIGHT}[ Getting User Query... ]{Style.RESET_ALL}", end="\r",
flush=True)
user_info = extract_user_data(query)
user_id = str(user_info.get('id'))
self.headers = get_headers(user_id)
try:
self.process_query(query)
except Exception as e:
self.log(f"{Fore.RED + Style.BRIGHT}An error process_query: {e}{Style.RESET_ALL}")
self.log(
f"{Fore.CYAN + Style.BRIGHT}----------------------------------------------------------------------------{Style.RESET_ALL}")
account_delay = config['account_delay']
countdown_timer(random.randint(min(account_delay), max(account_delay)))
cycle_delay = config['cycle_delay']
countdown_timer(random.randint(min(cycle_delay), max(cycle_delay)))
except KeyboardInterrupt:
self.log(f"{Fore.RED + Style.BRIGHT}[ EXIT ] Money DOGS - BOT{Style.RESET_ALL}")
except Exception as e:
self.log(f"{Fore.RED + Style.BRIGHT}An error occurred: {e}{Style.RESET_ALL}")
if __name__ == "__main__":
if s_name() == 'Windows':
sys(f'cls && title Money Dogs')
else:
sys('clear')
moneydogs = MoneyDOGS()
moneydogs.clear_terminal()
moneydogs.welcome()
moneydogs.main()