forked from gilanx04/dawn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdawn.py
More file actions
134 lines (111 loc) · 5.06 KB
/
dawn.py
File metadata and controls
134 lines (111 loc) · 5.06 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
import requests
import time
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
keepalive_url = "https://www.aeropres.in/chromeapi/dawn/v1/userreward/keepalive"
get_points_url = "https://www.aeropres.in/api/atom/v1/userreferral/getpoint"
def display_welcome_message():
print(r"""
_ _ _____ ___
(_) | | _ | / |
__ _ _| | __ _ _ __ __ _| |/' | / /| |
/ _` | | |/ _` | '_ \\ \/ / /| |/ /_| |
| (_| | | | (_| | | | |> <\ |_/ /\___ |
\__, |_|_|\__,_|_| |_/_/\_\\___/ |_/
__/ |
|___/
""")
def read_data_file(filename):
accounts = []
with open(filename, 'r') as file:
for line in file:
email, token = line.strip().split('|')
accounts.append({'email': email, 'token': token})
return accounts
def get_total_points(headers):
try:
response = requests.get(get_points_url, headers=headers, verify=False)
if response.status_code == 200:
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"\033[91mError fetching points: {json_response.get('message', 'Unknown error')}\033[0m")
elif response.status_code == 403:
print(f"\033[91mFailed to retrieve points. Status code: {response.status_code} - Forbidden. Token might be invalid or expired.\033[0m") # Red
else:
print(f"\033[91mFailed to retrieve points. Status code: {response.status_code}\033[0m") # Red
except requests.exceptions.RequestException as e:
print(f"\033[91mAn error occurred while fetching points: {e}\033[0m")
return 0
def make_request(headers, email):
keepalive_payload = {
"username": email,
"extensionid": "fpdkjdnhkakefebpekbdhillbhonfjjp",
"numberoftabs": 0,
"_v": "1.0.7"
}
try:
response = requests.post(keepalive_url, headers=headers, json=keepalive_payload, verify=False)
print(f"Status Code: \033[94m{response.status_code}\033[0m")
if response.status_code == 200:
json_response = response.json()
if 'message' in json_response:
print(f"\033[92mSukses: {json_response['message']}\033[0m")
return True
else:
print("\033[91mMessage not found in response.\033[0m")
elif response.status_code == 403:
print(f"\033[93m403 Forbidden. Email might be invalid for {email}. Skipping...\033[0m")
elif response.status_code == 502:
print("\033[93m502 Bad Gateway. gpp nanti bisa, lanjut aja ke akun berikutnya...\033[0m")
return False
except requests.exceptions.RequestException as e:
print(f"\033[91mAn error occurred: {e}\033[0m")
return False
def countdown(seconds):
for i in range(seconds, 0, -1):
print(f"\033[95mRestarting in: {i} seconds\033[0m", end='\r')
time.sleep(1)
print("\n\033[92mRestarting the process...\033[0m\n")
def main():
display_welcome_message()
while True:
accounts = read_data_file("data.txt")
total_accumulated_points = 0
for account in accounts:
email = account['email']
token = account['token']
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": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36"
}
print(f"\033[96mMemproses akun: {email}\033[0m")
points = get_total_points(headers)
total_accumulated_points += points
success = make_request(headers, email)
if success:
print(f"\033[92mRequest untuk {email} sukses.\033[0m\n")
else:
print(f"\033[91mRequest untuk {email} gagal bjir.\033[0m\n")
print(f"\033[93mSemua akun telah diproses.\033[0m")
print(f"\033[92mTotal poin dari semua user: {total_accumulated_points}\033[0m")
countdown(181)
if __name__ == "__main__":
main()