-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_no_proxy.py
47 lines (39 loc) · 1.47 KB
/
main_no_proxy.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
import requests
import uuid
import json
def generate_random_userid():
return str(uuid.uuid4())
def make_request(user_id):
url = 'https://api.discord.gx.games/v1/direct-fulfillment'
headers = {
'authority': 'api.discord.gx.games',
'accept': '/',
'accept-language': 'en-US,en;q=0.9',
'content-type': 'application/json',
'origin': 'https://www.opera.com',
'referer': 'https://www.opera.com/',
# Add other headers as required
}
data = {'partnerUserId': user_id}
response = requests.post(url, headers=headers, json=data)
return response
def append_token_to_url(token):
base_url = "https://discord.com/billing/partner-promotions/1180231712274387115/"
return f"{base_url}{token}"
def main():
num_tokens = int(input("Enter the number of tokens to generate: "))
for i in range(num_tokens):
user_id = generate_random_userid()
response = make_request(user_id)
try:
response_data = json.loads(response.text)
token = response_data.get("token")
if token:
full_url = append_token_to_url(token)
print(f"{i+1}.) URL with Token: {full_url}")
else:
print(f"{i+1}.) No token received in response.")
except json.JSONDecodeError:
print(f"{i+1}.) Error processing response: {response.text}")
if __name__ == "__main__":
main()