-
Notifications
You must be signed in to change notification settings - Fork 2
/
warp-key-generator.py
87 lines (69 loc) · 2.55 KB
/
warp-key-generator.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
import random
import httpx
import os
import time
import requests
ppkeys = requests.get(
"https://gitlab.com/Misaka-blog/warp-script/-/raw/main/files/24pbgen/base_keys"
)
pkeys = ppkeys.content.decode("UTF8")
keys = pkeys.split(",")
gkeys = []
value_int = int(
input("Please enter the number of WARP+ keys you need to generate:\n> ")
)
a = 0
while a < value_int:
a += 1
try:
headers = {
"CF-Client-Version": "a-6.11-2223",
"Host": "api.cloudflareclient.com",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"User-Agent": "okhttp/3.12.1",
}
with httpx.Client(
base_url="https://api.cloudflareclient.com/v0a2223",
headers=headers,
timeout=30.0,
) as client:
r = client.post("/reg")
id = r.json()["id"]
license = r.json()["account"]["license"]
token = r.json()["token"]
r = client.post("/reg")
id2 = r.json()["id"]
token2 = r.json()["token"]
headers_get = {"Authorization": f"Bearer {token}"}
headers_get2 = {"Authorization": f"Bearer {token2}"}
headers_post = {
"Content-Type": "application/json; charset=UTF-8",
"Authorization": f"Bearer {token}",
}
json = {"referrer": f"{id2}"}
client.patch(f"/reg/{id}", headers=headers_post, json=json)
client.delete(f"/reg/{id2}", headers=headers_get2)
key = random.choice(keys)
json = {"license": f"{key}"}
client.put(f"/reg/{id}/account", headers=headers_post, json=json)
json = {"license": f"{license}"}
client.put(f"/reg/{id}/account", headers=headers_post, json=json)
r = client.get(f"/reg/{id}/account", headers=headers_get)
account_type = r.json()["account_type"]
referral_count = r.json()["referral_count"]
license = r.json()["license"]
client.delete(f"/reg/{id}", headers=headers_get)
gkeys.append(license)
print(f"License Key: {license}\nData Count: {referral_count} of GB(s)")
except:
print("Error occurred.")
time.sleep(15)
if a % 2 == 0:
time.sleep(60)
os.system("cls" if os.name == "nt" else "clear")
print("The generated key list is below, please copy and paste for later use!")
print("For more content, please pay attention to: Xiao Misaka's broken website")
for x in gkeys:
print(x)
input("\n(Enter) to exit.\n")