-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdawn.py
240 lines (201 loc) Β· 9.3 KB
/
dawn.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
import requests
import time
import urllib3
import json
from colorama import init, Fore, Style
from fake_useragent import UserAgent
import os
import asyncio
import telegram
CONFIG_FILE = "config.json"
def read_config(filename=CONFIG_FILE):
try:
with open(filename, 'r') as file:
config = json.load(file)
return config
except FileNotFoundError:
print(f"{Fore.RED}[X] Error: Configuration file '{filename}' not found.{Style.BRIGHT}")
return {}
except json.JSONDecodeError:
print(f"{Fore.RED}[X] Error: Invalid JSON format in '{filename}'.{Style.BRIGHT}")
return {}
config = read_config(CONFIG_FILE)
bot_token = config.get("telegram_bot_token")
chat_id = config.get("telegram_chat_id")
if not bot_token or not chat_id:
print(f"{Fore.RED}[X] Error: Missing 'bot_token' or 'chat_id' in 'config.json'.{Style.BRIGHT}")
exit(1)
bot = telegram.Bot(token=bot_token)
keepalive_url = "https://www.aeropres.in/chromeapi/dawn/v1/userreward/keepalive"
get_points_url = "https://www.aeropres.in/api/atom/v1/userreferral/getpoint"
extension_id = "fpdkjdnhkakefebpekbdhillbhonfjjp"
_v = "1.0.7"
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
ua = UserAgent()
init(autoreset=True)
def banner():
os.system("title DAWN Validator" if os.name == "nt" else "clear")
os.system("cls" if os.name == "nt" else "clear")
print(Fore.CYAN + Style.BRIGHT + r"""
___ ___ _ __ _ __
/ _ \ / _ || | /| / // |/ /
/ // // __ || |/ |/ // /
/____//_/ |_||__/|__//_/|_/ https://github.com/gilanx04
_ __ ___ __ ____ ___ ___ ______ ____ ___
| | / // _ | / / / _// _ \ / _ |/_ __// __ \ / _ \
| |/ // __ | / /__ _/ / / // // __ | / / / /_/ // , _/
|___//_/ |_|/____//___//____//_/ |_|/_/ \____//_/|_|
""" + Style.BRIGHT)
def read_account(filename="config.json"):
try:
with open(filename, 'r') as file:
data = json.load(file)
accounts = data.get("accounts", [])
return accounts
except FileNotFoundError:
print(f"{Fore.RED}[X] Error: config file '{filename}' not found.{Style.BRIGHT}")
asyncio.run(telegram_message(f"π¨ DAWN VALIDATOR NOTIFICATION π¨\n\nβ Failed to read the config.json file. Check the configuration file."))
return []
except json.JSONDecodeError:
print(f"{Fore.RED}[X] Error: Invalid JSON format in '{filename}'.{Style.BRIGHT}")
asyncio.run(telegram_message(f"π¨ DAWN VALIDATOR NOTIFICATION π¨\n\nβ The JSON format in the file '{filename}' is not valid."))
return []
def read_proxies(filename="proxies.txt"):
try:
with open(filename, 'r') as file:
proxies = [line.strip() for line in file.readlines()]
return proxies
except FileNotFoundError:
print(f"{Fore.RED}[X] Error: '{filename}' not found.{Style.BRIGHT}")
return []
def format_proxy(proxy_str):
try:
ip, port, username, password = proxy_str.split(':')
proxy = f"http://{username}:{password}@{ip}:{port}"
return {
"http": proxy,
"https": proxy
}
except ValueError:
print(f"{Fore.RED}[X] Error: Proxy format is incorrect for '{proxy_str}'.{Style.BRIGHT}")
return None
def total_points(headers, url_point):
try:
response = requests.get(url_point, headers=headers, verify=False)
response.raise_for_status()
json_response = response.json()
if json_response.get("status"):
reward_point_data = json_response["data"]["rewardPoint"]
referral_point_data = json_response["data"]["referralPoint"]
total_points = (
reward_point_data.get("points", 0) +
reward_point_data.get("registerpoints", 0) +
reward_point_data.get("signinpoints", 0) +
reward_point_data.get("twitter_x_id_points", 0) +
reward_point_data.get("discordid_points", 0) +
reward_point_data.get("telegramid_points", 0) +
reward_point_data.get("bonus_points", 0) +
referral_point_data.get("commission", 0)
)
return total_points
else:
print(f"{Fore.YELLOW}[!] Warning: {json_response.get('message', 'Unknown error when fetching points')}{Style.BRIGHT}")
except requests.exceptions.RequestException as e:
print(f"{Fore.RED}[X] Error: {e}{Style.BRIGHT}")
return 0
def keep_alive(headers, url_keepalive, email, proxies=None ):
keepalive_payload = {
"username": email,
"extensionid": extension_id,
"numberoftabs": 0,
"_v": _v
}
headers["User-Agent"] = ua.random
try:
response = requests.post(url_keepalive, headers=headers, json=keepalive_payload, verify=False, proxies=proxies)
response.raise_for_status()
json_response = response.json()
if 'message' in json_response:
return True, json_response['message']
else:
return False, "Message not found in response"
except requests.exceptions.RequestException as e:
return False, str(e)
def countdown(seconds):
for i in range(seconds, 0, -1):
print(f"{Fore.LIGHTBLUE_EX}[~] Restarting in: {i} seconds", end='\r')
time.sleep(1)
async def telegram_message(message):
try:
await bot.send_message(chat_id=chat_id, text=message)
except Exception as e:
print(f"{Fore.RED}[X] Error sending Telegram message: {e}{Style.BRIGHT}")
async def main():
banner()
accounts = read_account()
proxies = read_proxies()
if not accounts or not proxies:
print(f"{Fore.RED}[X] Error: Missing accounts or proxies.{Style.BRIGHT}")
return
if len(proxies) < len(accounts):
print(f"{Fore.YELLOW}[!] Warning: Not enough proxies for all accounts. Some accounts will not use proxies.{Style.BRIGHT}")
total_points_all_users = 0
for account_index, account in enumerate(accounts):
email = account["email"]
token = account["token"]
url_point = f"https://www.aeropres.in/api/atom/v1/userreferral/getpoint?appid={account['appid']}"
url_keepalive = f"https://www.aeropres.in/chromeapi/dawn/v1/userreward/keepalive?appid/getpoint?appid={account['appid']}"
# Assign proxy for the account
if account_index < len(proxies):
proxy = proxies[account_index]
proxy_dict = format_proxy(proxy)
if proxy_dict:
proxy_message = f"Proxy used: {proxy}"
else:
proxy_message = f"Invalid proxy format: {proxy}"
proxy_dict = None
else:
proxy_dict = None
proxy_message = "No proxy used"
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
"User-Agent": ua.random
}
print(f"{Fore.CYAN}βββββββββββββ[ DAWN Validator | Account {account_index + 1} ]βββββββββββββ{Style.BRIGHT}")
print(f"{Fore.MAGENTA}[@] Email: {email}{Style.BRIGHT}")
print(f"{Fore.MAGENTA}[@] {proxy_message}{Style.BRIGHT}")
points = total_points(headers,url_point)
total_points_all_users += points
success, status_message = keep_alive(headers,url_keepalive , email, proxies=proxy_dict )
if success:
message = f"""β΄οΈ DAWN VALIDATOR NOTIFICATION β΄οΈ
π€ Account: {email}
βΉοΈ Status: Keep alive β
π° Points: +{points:,.0f}
π {proxy_message}
GG! Your account successfully "Keep Alive". See you on the next loop. π"""
await telegram_message(message)
print(f"{Fore.GREEN}[β] Status: Keep alive recorded{Style.BRIGHT}")
print(f"{Fore.GREEN}[β] Request for {email} successful.{Style.BRIGHT}\n")
else:
message = f"""π¨ DAWN VALIDATOR NOTIFICATION π¨
π€ Account: {email}
βΉοΈ Status: Failed β
π° Points: +{points:,.0f}
β οΈ Error: {status_message}
π {proxy_message}
Oops! There was an error in the "Keep Alive" process. We'll retry soon. π"""
await telegram_message(message)
print(f"{Fore.RED}[X] Status: Keep alive failed!{Style.BRIGHT}")
print(f"{Fore.RED}[X] Error: {status_message}{Style.BRIGHT}\n")
print(f"{Fore.CYAN}ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ{Style.BRIGHT}")
print(f"{Fore.MAGENTA}[@] All accounts processed.{Style.BRIGHT}")
print(f"{Fore.GREEN}[+] Total points from all users: {total_points_all_users}{Style.BRIGHT}")
countdown(181)
print(f"\n{Fore.GREEN}[β] Restarting the process...{Style.BRIGHT}\n")
if __name__ == "__main__":
asyncio.run(main())