forked from TheCaduceus/WARP-UNLIMITED-ADVANCED
-
Notifications
You must be signed in to change notification settings - Fork 0
/
warp-plus.py
172 lines (154 loc) · 5.44 KB
/
warp-plus.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
import asyncio
import os
import urllib.request
import httpx
from config import Vars, log
from datetime import datetime
from json import dumps
from random import choice
from string import ascii_letters, digits
from sys import stdout
from time import sleep
from warnings import filterwarnings
from nest_asyncio import apply
# Default
HIDE_ID = "0"
if Vars[5] == True:
while True:
referrer = input("Enter WARP CLIENT ID:\n")
resp = input(
f"ID:{referrer}\nDo you want to continue with this ID? 1 = Yes or 0 = No\n"
)
if resp == "1":
break
SEND_LOG = input("Do you want to get log on Telegram? 1 = Yes or 0 = No\n")
if SEND_LOG == "1":
CHANNEL_ID = input(
"Enter CHAT ID, in which you want log message to be sent:\n")
BOT_TOKEN = input(
"Enter BOT_TOKEN, through which log message will be sent:\n")
HIDE_ID = input(
"Do you want to hide WARP CLIENT ID in log message? 1 = Yes or 0 = No:\n"
)
else:
referrer = Vars[0]
SEND_LOG = Vars[1]
CHANNEL_ID = Vars[2]
BOT_TOKEN = Vars[3]
HIDE_ID = Vars[4]
MSG_ID = False
if HIDE_ID == "1":
key_length = len(referrer) - 11
hidden_key = "*" * key_length + referrer[-11:]
apply()
filterwarnings("ignore", category=DeprecationWarning)
g = 0
b = 0
def genString(stringLength):
try:
letters = ascii_letters + digits
return ''.join(choice(letters) for _ in range(stringLength))
except Exception as error:
print(error)
def digitString(stringLength):
try:
digit = digits
return ''.join(choice(digit) for _ in range(stringLength))
except Exception as error:
print(error)
url = f"https://api.cloudflareclient.com/v0a{digitString(3)}/reg"
async def run():
try:
install_id = genString(22)
body = {
"key": f"{genString(43)}=",
"install_id": install_id,
"fcm_token": f"{install_id}:APA91b{genString(134)}",
"referrer": referrer,
"warp_enabled": False,
"tos": f"{datetime.now().isoformat()[:-3]}+02:00",
"type": "Android",
"locale": "es_ES"
}
data = dumps(body).encode("utf8")
headers = {
"Content-Type": "application/json; charset=UTF-8",
"Host": "api.cloudflareclient.com",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"User-Agent": "okhttp/3.12.1"
}
req = urllib.request.Request(url, data, headers)
response = urllib.request.urlopen(req)
return response.getcode()
except Exception as error:
return error
async def animation():
cooldown = 0.3
os.system("cls" if os.name == "nt" else "clear")
animation = [
"[□□□□□□□□□□] 0%", "[■□□□□□□□□□] 10%", "[■■□□□□□□□□] 20%",
"[■■■□□□□□□□] 30%", "[■■■■□□□□□□] 40%", "[■■■■■□□□□□] 50%",
"[■■■■■■□□□□] 60%", "[■■■■■■■□□□] 70%", "[■■■■■■■■□□] 80%",
"[■■■■■■■■■□] 90%", "[■■■■■■■■■■] 100%"
]
for i in range(len(animation)):
stdout.write("\r[∆] Progress: " + animation[i % len(animation)])
stdout.flush()
if i == 2:
result = await run()
if result != 200:
cooldown = 0.1
await asyncio.sleep(cooldown)
return result
while True:
anim = asyncio.get_event_loop()
anim_coroutine = animation()
result = anim.run_until_complete(anim_coroutine)
if result == 200:
g += 1
if SEND_LOG == "1" and HIDE_ID == "1":
if not MSG_ID:
api_resp = httpx.post(
f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage?chat_id={CHANNEL_ID}&parse_mode=HTML&text=<b><u>WARP STATISTICS</u></b>%0AWARP%20ID:%20{hidden_key}%0ADATA%20RECEIVED:%20%0A{g}GB%20%0AFAILED:%20%0A{str(b)}"
)
get_stats = api_resp.json()
try:
MSG_ID = get_stats["result"]["message_id"]
except KeyError:
log.error(f"API Response: {get_stats}")
raise
else:
httpx.post(
f"https://api.telegram.org/bot{BOT_TOKEN}/editMessageText?chat_id={CHANNEL_ID}&message_id={MSG_ID}&parse_mode=HTML&text=<b><u>WARP STATISTICS</u></b>%0AWARP%20ID:%20{hidden_key}%0ADATA%20RECEIVED:%20%0A{g}GB%20%0AFAILED:%20%0A{str(b)}"
)
elif SEND_LOG == "1" and HIDE_ID == "0":
if not MSG_ID:
api_resp = httpx.post(
f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage?chat_id={CHANNEL_ID}&parse_mode=HTML&text=<b><u>WARP STATISTICS</u></b>%0AWARP%20ID:%20{referrer}%0ADATA%20RECEIVED:%20%0A{g}GB%20%0AFAILED:%20%0A{str(b)}"
)
get_stats = api_resp.json()
try:
MSG_ID = get_stats["result"]["message_id"]
except KeyError:
log.error(f"API Response: {get_stats}")
raise
else:
httpx.post(
f"https://api.telegram.org/bot{BOT_TOKEN}/editMessageText?chat_id={CHANNEL_ID}&message_id={MSG_ID}&parse_mode=HTML&text=<b><u>WARP STATISTICS</u></b>%0AWARP%20ID:%20{referrer}%0ADATA%20RECEIVED:%20%0A{str(g)}GB%20%0AFAILED:%20%0A{str(b)}"
)
print(f"\n[•] WARP+ ID: {referrer}")
print(f"[✓] Added: {g} GB")
print(f"[#] Total: {g} Good {b} Bad")
for i in range(20, 1, -1):
stdout.write(f"\033[1K\r[!] Cooldown: {i} seconds")
stdout.flush()
sleep(1)
else:
b += 1
print("\n[×] Error:", result)
print(f"[#] Total: {g} Good {b} Bad")
for i in range(30, -1, -1):
stdout.write(f"\033[1K\r[!] Cooldown: {i} seconds")
stdout.flush()
sleep(1)