├── README.md
├── config.yml
├── data
├── adjectives.txt
└── nouns.txt
├── internal
├── logger.py
└── utils.py
├── main.py
├── proxies.txt
└── requirements.txt
/README.md:
--------------------------------------------------------------------------------
1 | # Alienware Promo Generator
2 | # TempMail has been flagged on Alienware leading to the generator not working anymore. 100 stars for outlook/hotmail support.
3 |
4 | - Creates 1 Month Nitro Promo Links using the Nitro X Alienware collaboration.
5 | - Buy Best Discord Tools & Best Residential Proxies at https://boostup.cc
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | ## How To Run?
16 | > 1) Clone / download this repository.
17 | > 2) Open the folder in command prompt or terminal.
18 | > 3) Run the command: `pip install -r requirements.txt`.
19 | > 4) Put sticky residential Indian proxies in `proxies.txt`, format: `username:password@host:port` or `ip:port`.
20 | > 5) Put capsolver API key (https://dashboard.capsolver.com/passport/register?inviteCode=LyJfsyi3ypCa) in the `capsolver-key` variable in the config after adding balance in your capsolver account.
21 | > 6) Run using `python main.py`.
22 |
23 | # Disclaimer
24 |
25 | This is intended for educational purposes only. The creator assumes no responsibility for any illegal activities carried out with it, and the code is made public for viewing purposes only. Please use this ethically and responsibly.
26 |
27 | # Note
28 |
29 | Do NOT message me asking for help. I will block you.
30 |
--------------------------------------------------------------------------------
/config.yml:
--------------------------------------------------------------------------------
1 | retries: 15
2 | # Number of retries for the API call
3 |
4 | capsolver-key: ""
5 | # Input your https://dashboard.capsolver.com/passport/register?inviteCode=LyJfsyi3ypCa API Key in the field above.
6 |
--------------------------------------------------------------------------------
/data/adjectives.txt:
--------------------------------------------------------------------------------
1 | abject
2 | aboard
3 | adoring
4 | affected
5 | alert
6 | aloof
7 | amazed
8 | amused
9 | annoyed
10 | anxious
11 | ardent
12 | artistic
13 | ashamed
14 | awed
15 | betrayed
16 | blissful
17 | boastful
18 | bored
19 | brainy
20 | bubbly
21 | cautious
22 | cheerful
23 | chic
24 | cocky
25 | content
26 | cruel
27 | crummy
28 | crushed
29 | cultured
30 | curious
31 | cynical
32 | dear
33 | debonair
34 | decimal
35 | dejected
36 | dopey
37 | dreadful
38 | dreary
39 | eager
40 | ecstatic
41 | empathic
42 | empty
43 | enraged
44 | envious
45 | euphoric
46 | exacting
47 | excited
48 | excluded
49 | fervent
50 | finicky
51 | fond
52 | forsaken
53 | giddy
54 | gleeful
55 | gloomy
56 | goofy
57 | grizzled
58 | grudging
59 | grumpy
60 | guilty
61 | guttural
62 | holistic
63 | humorous
64 | hushed
65 | imported
66 | innocent
67 | insecure
68 | jealous
69 | joyful
70 | jubilant
71 | jumpy
72 | kind
73 | lazy
74 | lovesick
75 | lying
76 | mad
77 | mellow
78 | merciful
79 | mere
80 | mild
81 | morbid
82 | murky
83 | needful
84 | needy
85 | obsessed
86 | offended
87 | outlying
88 | pacified
89 | panicky
90 | peaceful
91 | pesky
92 | pitiful
93 | pleased
94 | plucky
95 | prideful
96 | puzzled
97 | relieved
98 | resolved
99 | sad
100 | scornful
101 | selfish
102 | shameful
103 | sheepish
104 | shy
105 | similar
106 | sincere
107 | solemn
108 | solid
109 | somber
110 | sore
111 | spirited
112 | stressed
113 | sugary
114 | superior
115 | taut
116 | thrifty
117 | thrilled
118 | troubled
119 | trusting
120 | truthful
121 | unhappy
122 | vengeful
123 | wakeful
124 | weary
125 | winged
126 | worldly
127 | wornout
128 | worried
129 | wrathful
130 | yearning
131 | zesty
--------------------------------------------------------------------------------
/data/nouns.txt:
--------------------------------------------------------------------------------
1 | abalone
2 | antelope
3 | apples
4 | apricots
5 | baboon
6 | bagels
7 | basmati
8 | bass
9 | bittern
10 | boa
11 | boars
12 | bobolink
13 | buck
14 | burritos
15 | bustard
16 | buzzard
17 | cake
18 | camel
19 | cardinal
20 | caribou
21 | caviar
22 | chamois
23 | cheese
24 | cheetah
25 | chile
26 | chough
27 | chowder
28 | clam
29 | coati
30 | cockatoo
31 | coconut
32 | cod
33 | cordial
34 | cow
35 | crackers
36 | crane
37 | cur
38 | curlew
39 | dingo
40 | dinosaur
41 | dotterel
42 | doughnut
43 | dove
44 | doves
45 | dunbird
46 | eagle
47 | eggs
48 | eland
49 | falcon
50 | ferret
51 | fish
52 | flamingo
53 | garlic
54 | gatorade
55 | gelding
56 | gnu
57 | granola
58 | hare
59 | hawk
60 | heron
61 | hoopoe
62 | hyena
63 | icecream
64 | iguana
65 | jaguar
66 | jerky
67 | kitten
68 | lapwing
69 | lard
70 | lemur
71 | leopard
72 | lion
73 | lizard
74 | llama
75 | locust
76 | lollies
77 | macaw
78 | mackerel
79 | magpie
80 | mallard
81 | mandrill
82 | mare
83 | meerkat
84 | moth
85 | muesli
86 | mussel
87 | oatmeal
88 | ocelot
89 | oil
90 | orange
91 | oryx
92 | otter
93 | owl
94 | paella
95 | pear
96 | pepper
97 | pie
98 | piglet
99 | plover
100 | polenta
101 | ponie
102 | porpoise
103 | poultry
104 | pretzels
105 | pudding
106 | pup
107 | quiche
108 | raisins
109 | rat
110 | relish
111 | rhino
112 | rice
113 | ruffs
114 | salami
115 | salt
116 | sardines
117 | sausage
118 | seafowl
119 | seagull
120 | seahorse
121 | shads
122 | sheep
123 | smelt
124 | snail
125 | snipe
126 | stork
127 | swift
128 | syrup
129 | tacos
130 | teal
131 | termite
132 | thrush
133 | thrushe
134 | tomatoe
135 | tortoise
136 | toucan
137 | truffle
138 | tuna
139 | unicorn
140 | venison
141 | viper
142 | wasp
143 | weaver
144 | whiting
145 | widgeon
146 | wigeon
147 | wildfowl
148 | zebra
--------------------------------------------------------------------------------
/internal/logger.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | from colorama import Fore
4 |
5 |
6 | class Logger:
7 | @staticmethod
8 | def info(content: str) -> None:
9 | print(
10 | f'{Fore.LIGHTBLACK_EX}[{datetime.datetime.now().strftime("%I:%M:%S %p")}] {Fore.GREEN}{content}{Fore.RESET}'
11 | )
12 |
13 | @staticmethod
14 | def error(content: str) -> None:
15 | print(
16 | f'{Fore.LIGHTBLACK_EX}[{datetime.datetime.now().strftime("%I:%M:%S %p")}] {Fore.RED}{content}{Fore.RESET}'
17 | )
18 |
19 | @staticmethod
20 | def inp(content: str) -> str:
21 | return (
22 | f'{Fore.LIGHTBLACK_EX}[{datetime.datetime.now().strftime("%I:%M:%S %p")}] {Fore.CYAN}{content}{Fore.RESET}'
23 | )
--------------------------------------------------------------------------------
/internal/utils.py:
--------------------------------------------------------------------------------
1 | import os
2 | import yaml
3 | import time
4 | import string
5 | import random
6 | import requests
7 | if os.name == "nt":
8 | import ctypes
9 |
10 | from bs4 import BeautifulSoup
11 |
12 |
13 | with open("config.yml", "r") as c:
14 | config = yaml.safe_load(c)
15 |
16 | class Data:
17 | generated = int()
18 |
19 |
20 | CAPSOLVER_KEY = config["capsolver-key"]
21 |
22 |
23 | class Utils:
24 |
25 | @staticmethod
26 | def generate_password():
27 | upper_case_letter = random.choice(string.ascii_uppercase)
28 | lower_case_string = ''.join(random.choices(string.ascii_lowercase, k=5))
29 | digit = random.choice(string.digits)
30 | special_char = random.choice(["!", "@", "#", "$", "%", "&", "*"])
31 |
32 | password = upper_case_letter + lower_case_string + digit + special_char
33 | password = list(password)
34 | random.shuffle(password)
35 | password = ''.join(password)
36 | return password
37 |
38 | @staticmethod
39 | def generate_username():
40 | # Partly taken from https://github.com/williexu/random_username/
41 |
42 | with open("./data/adjectives.txt", "r") as adjectives_file:
43 | adjectives = adjectives_file.read().splitlines()
44 | with open("./data/nouns.txt", "r") as nouns_file:
45 | nouns = nouns_file.read().splitlines()
46 |
47 | adjective = random.choice(adjectives)
48 | noun = random.choice(nouns).capitalize()
49 | num = str(random.randrange(10))
50 | username = adjective + noun + num
51 |
52 | return username
53 |
54 | @staticmethod
55 | def fetch_email() -> str:
56 | response = requests.get("https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1")
57 | if response.status_code == 200:
58 | email = response.json()[0]
59 | return email
60 | else:
61 | return Utils.fetch_email()
62 |
63 | @staticmethod
64 | def solve_recaptcha(user_agent: str, page_action: str) -> str:
65 | task_payload = {
66 | "clientKey": CAPSOLVER_KEY,
67 | "appId": "C10FB33E-8CED-4F6D-990C-356E42F5E318",
68 | "task": {
69 | "type": "ReCaptchaV3TaskProxyLess",
70 | "websiteURL": "https://in.alienwarearena.com/",
71 | "websiteKey": "6LfRnbwaAAAAAPYycaGDRhoUqR-T0HyVwVkGEnmC",
72 | "pageAction": page_action,
73 | "userAgent": user_agent
74 | }
75 | }
76 |
77 | response = requests.post("https://api.capsolver.com/createTask", json=task_payload)
78 | if response.status_code == 200:
79 | task_id = response.json()["taskId"]
80 | else:
81 | raise Exception(f"Failed to create captcha task | {response.text}")
82 |
83 | solution_payload = {
84 | "clientKey": CAPSOLVER_KEY,
85 | "taskId": task_id
86 | }
87 |
88 | while True:
89 | response = requests.post("https://api.capsolver.com/getTaskResult", json=solution_payload)
90 | if "ready" in response.text:
91 | return response.json()["solution"]["gRecaptchaResponse"]
92 | elif "processing" in response.text:
93 | time.sleep(1)
94 | continue
95 | else:
96 | raise Exception("Failed to solve captcha.")
97 |
98 | @staticmethod
99 | def extract_token(html: str, name: str) -> str:
100 | soup = BeautifulSoup(html, 'html.parser')
101 | token = soup.find('input', {'name': name}).get('value')
102 | return token
103 |
104 | @staticmethod
105 | def extract_link(html: str) -> str:
106 | soup = BeautifulSoup(html, 'html.parser')
107 | activation_link = soup.find('a', class_='mcnButton')['href']
108 | return activation_link
109 |
110 | @staticmethod
111 | def extract_verification_link(user: str, domain: str) -> str:
112 | count = int()
113 | while count < 60:
114 | response = requests.get(f"https://www.1secmail.com/api/v1/?action=getMessages&login={user}&domain={domain}")
115 | if "Activate Your Alienware Arena Account" in response.text:
116 | for message in response.json():
117 | if message["subject"] == "Activate Your Alienware Arena Account":
118 | message_id = message["id"]
119 | response = requests.get(f"https://www.1secmail.com/api/v1/?action=readMessage&login={user}&domain={domain}&id={message_id}")
120 | if response.status_code == 200:
121 | message_content = response.json()["body"]
122 | return Utils.extract_link(message_content)
123 | else:
124 | count += 1
125 | time.sleep(3)
126 | else:
127 | raise Exception(f"Failed to get verification email | {user}@{domain}")
128 |
129 | @staticmethod
130 | def set_title():
131 | if os.name == "nt":
132 | while True:
133 | title = f"Alienware Promo Generator | github.com/Pixens | Generated: {Data.generated}"
134 | ctypes.windll.kernel32.SetConsoleTitleW(title)
135 | time.sleep(3)
136 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import re
2 | import os
3 | import yaml
4 | import json
5 | import time
6 | import names
7 | import random
8 | import itertools
9 | import threading
10 | import tls_client
11 |
12 | from internal.logger import Logger
13 | from internal.utils import Utils, Data
14 | from tls_client.exceptions import TLSClientExeption
15 |
16 |
17 | os.system("")
18 |
19 | with open("config.yml", "r") as c:
20 | config = yaml.safe_load(c)
21 |
22 | with open("proxies.txt", "r") as p:
23 | proxies = itertools.cycle(p.read().splitlines())
24 |
25 | END = False
26 | RETRIES = config["retries"]
27 | THREAD_LOCK = threading.Lock()
28 |
29 |
30 | class GeneratePromo:
31 |
32 | def __init__(self) -> None:
33 | self.chrome_version = str(random.randint(115, 122))
34 | self.user_agent = f"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{self.chrome_version}.0.0.0 Safari/537.36"
35 | # noinspection PyTypeChecker
36 | self.session = tls_client.Session(
37 | client_identifier=f"chrome_{self.chrome_version}",
38 | random_tls_extension_order=True
39 | )
40 | self.session.timeout_seconds = 30
41 |
42 | self.proxy = next(proxies)
43 | self.session.proxies = {
44 | "http": f"http://{self.proxy}",
45 | "https": f"http://{self.proxy}"
46 | }
47 |
48 | self.page_headers = {
49 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
50 | "Accept-Encoding": "gzip, deflate, br",
51 | "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
52 | "Cache-Control": "max-age=0",
53 | "Connection": "keep-alive",
54 | "Host": "in.alienwarearena.com",
55 | "Origin": "https://in.alienwarearena.com",
56 | "Referer": "https://in.alienwarearena.com/account/register",
57 | "sec-ch-ua": f'"Chromium";v="{self.chrome_version}", "Not(A:Brand";v="24", "Google Chrome";v="{self.chrome_version}"',
58 | "sec-ch-ua-mobile": "?0",
59 | "sec-ch-ua-platform": '"macOS"',
60 | "Sec-Fetch-Dest": "document",
61 | "Sec-Fetch-Mode": "navigate",
62 | "Sec-Fetch-Site": "same-origin",
63 | "Sec-Fetch-User": "?1",
64 | "Upgrade-Insecure-Requests": "1",
65 | "User-Agent": self.user_agent
66 | }
67 |
68 | self.email_headers = {
69 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
70 | "Accept-Encoding": "gzip, deflate, br",
71 | "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
72 | "Connection": "keep-alive",
73 | "Host": "mandrillapp.com",
74 | "sec-ch-ua": f'"Chromium";v="{self.chrome_version}", "Not(A:Brand";v="24", "Google Chrome";v="{self.chrome_version}"',
75 | "sec-ch-ua-mobile": "?0",
76 | "sec-ch-ua-platform": '"macOS"',
77 | "Sec-Fetch-Dest": "document",
78 | "Sec-Fetch-Mode": "navigate",
79 | "Sec-Fetch-Site": "none",
80 | "Sec-Fetch-User": "?1",
81 | "Upgrade-Insecure-Requests": "1"
82 | }
83 |
84 | self.key_headers = {
85 | "Accept": "*/*",
86 | "Accept-Encoding": "gzip, deflate, br",
87 | "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
88 | "Authorization": "",
89 | "Connection": "keep-alive",
90 | "Host": "giveawayapi.alienwarearena.com",
91 | "Origin": "https://in.alienwarearena.com",
92 | "Referer": "https://in.alienwarearena.com/",
93 | "sec-ch-ua": f'"Chromium";v="{self.chrome_version}", "Not(A:Brand";v="24", "Google Chrome";v="{self.chrome_version}"',
94 | "sec-ch-ua-mobile": "?0",
95 | "sec-ch-ua-platform": '"macOS"',
96 | "Sec-Fetch-Dest": "empty",
97 | "Sec-Fetch-Mode": "cors",
98 | "Sec-Fetch-Site": "same-site",
99 | "User-Agent": self.user_agent
100 | }
101 |
102 | self.request_headers = {
103 | "Accept": "application/json, text/javascript, */*; q=0.01",
104 | "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
105 | "Connection": "keep-alive",
106 | "Host": "in.alienwarearena.com",
107 | "Referer": "https://in.alienwarearena.com/ucf/show/2170237/boards/contest-and-giveaways-global/one-month-of-discord-nitro-exclusive-key-giveaway",
108 | "sec-ch-ua": f'"Chromium";v="{self.chrome_version}", "Not(A:Brand";v="24", "Google Chrome";v="{self.chrome_version}"',
109 | "sec-ch-ua-mobile": "?0",
110 | "sec-ch-ua-platform": '"macOS"',
111 | "Sec-Fetch-Dest": "empty",
112 | "Sec-Fetch-Mode": "cors",
113 | "Sec-Fetch-Site": "same-origin",
114 | "User-Agent": self.user_agent,
115 | "X-Requested-With": "XMLHttpRequest"
116 | }
117 |
118 | self.email = Utils.fetch_email()
119 |
120 | def register_account(self, tries: int = 1) -> bool:
121 | if tries > RETRIES:
122 | raise Exception(f"Failed to register account after {RETRIES} tries | {self.email}.")
123 |
124 | try:
125 | response = self.session.get("https://in.alienwarearena.com/account/register", headers=self.page_headers)
126 | except TLSClientExeption:
127 | return self.register_account(tries + 1)
128 |
129 | token = Utils.extract_token(response.text, "user_registration[_token]")
130 |
131 | data = {
132 | "user_registration[email][first]": self.email,
133 | "user_registration[email][second]": self.email,
134 | "user_registration[birthdate][month]": random.randint(1, 12),
135 | "user_registration[birthdate][day]": random.randint(1, 28),
136 | "user_registration[birthdate][year]": random.randint(1970, 2004),
137 | "user_registration[termsAccepted]": 1,
138 | "user_registration[_token]": token,
139 | "user_registration[steamId]": "",
140 | "user_registration[battlenetOauthProfileId]": "",
141 | "user_registration[timezone]": "Asia/Kolkata",
142 | "user_registration[sourceInfo]": None,
143 | "user_registration[referralCode]": "",
144 | "user_registration[recaptcha3]": Utils.solve_recaptcha(self.user_agent, "registration")
145 | }
146 |
147 | try:
148 | response = self.session.post("https://in.alienwarearena.com/account/register", headers=self.page_headers, data=data, allow_redirects=True)
149 | except TLSClientExeption:
150 | return self.register_account(tries + 1)
151 |
152 | if response.url != "https://in.alienwarearena.com/account/check-email":
153 | try:
154 | error = response.text.split('class="form-error-message">')[1].split('')[0]
155 | except Exception:
156 | raise Exception(f"Failed to register account | {self.email}")
157 |
158 | raise Exception(f"Failed to register account | {self.email} | {error.strip()}")
159 |
160 | else:
161 | return True
162 |
163 | def verify_email(self, verification_link: str, tries: int = 1) -> bool:
164 | if tries > RETRIES:
165 | raise Exception(f"Failed to verify account after {RETRIES} tries | {self.email}.")
166 |
167 | self.session.cookies.clear()
168 |
169 | try:
170 | response = self.session.get(verification_link, headers=self.email_headers)
171 | response = self.session.get(response.headers["Location"], headers=self.page_headers)
172 | except TLSClientExeption:
173 | return self.verify_email(verification_link, tries + 1)
174 |
175 | token = Utils.extract_token(response.text, "platformd_user_confirm_registration[_token]")
176 | data = {
177 | "platformd_user_confirm_registration[confirm]": "",
178 | "platformd_user_confirm_registration[_token]": token
179 | }
180 | try:
181 | response = self.session.post(response.url, headers=self.page_headers, data=data)
182 | except TLSClientExeption:
183 | return self.verify_email(verification_link, tries + 1)
184 |
185 | if response.status_code == 302:
186 | return True
187 | else:
188 | raise Exception(f"Failed to verify e-mail | {response.status_code} | {self.email}")
189 |
190 | def set_password(self, tries: int = 1) -> None:
191 | if tries > RETRIES:
192 | raise Exception(f"Failed to complete registration after {RETRIES} tries | {self.email}.")
193 |
194 | try:
195 | response = self.session.get("https://in.alienwarearena.com/incomplete", headers=self.page_headers)
196 | except TLSClientExeption:
197 | return self.set_password(tries + 1)
198 |
199 | token = Utils.extract_token(response.text, "platformd_incomplete_account[_token]")
200 |
201 | password = Utils.generate_password()
202 | data = {
203 | "platformd_incomplete_account[username]": Utils.generate_username(),
204 | "platformd_incomplete_account[password][first]": password,
205 | "platformd_incomplete_account[password][second]": password,
206 | "platformd_incomplete_account[_token]": token
207 | }
208 |
209 | try:
210 | self.session.post("https://in.alienwarearena.com/incomplete", headers=self.page_headers, data=data, allow_redirects=True)
211 | except TLSClientExeption:
212 | return self.set_password(tries + 1)
213 |
214 | def complete_profile(self, tries: int = 1) -> bool:
215 | if tries > RETRIES:
216 | raise Exception(f"Failed to complete registration after {RETRIES} tries | {self.email}.")
217 |
218 | try:
219 | response = self.session.get("https://in.alienwarearena.com/incomplete", headers=self.page_headers)
220 | except TLSClientExeption:
221 | return self.complete_profile(tries + 1)
222 |
223 | token = Utils.extract_token(response.text, "platformd_incomplete_account[_token]")
224 | data = {
225 | "platformd_incomplete_account[firstname]": names.get_first_name(),
226 | "platformd_incomplete_account[lastname]": names.get_last_name(),
227 | "platformd_incomplete_account[country]": "IN",
228 | "platformd_incomplete_account[state]": "1297",
229 | "platformd_incomplete_account[preferredGenre]": random.choice(["action", "adventure"]),
230 | "platformd_incomplete_account[_token]": token
231 | }
232 |
233 | try:
234 | response = self.session.post("https://in.alienwarearena.com/incomplete", headers=self.page_headers, data=data, allow_redirects=True)
235 | except TLSClientExeption:
236 | return self.complete_profile(tries + 1)
237 |
238 | if response.status_code == 200:
239 | return True
240 | else:
241 | raise Exception(f"Failed to complete registration | {self.email}")
242 |
243 | def get_promo_details(self, tries: int = 1) -> tuple:
244 | if tries > RETRIES:
245 | raise Exception(f"Failed to get promo details after {RETRIES} tries | {self.email}.")
246 |
247 | try:
248 | response = self.session.get("https://in.alienwarearena.com/ucf/show/2170237/boards/contest-and-giveaways-global/one-month-of-discord-nitro-exclusive-key-giveaway", headers=self.page_headers)
249 | except TLSClientExeption:
250 | return self.get_promo_details(tries + 1)
251 |
252 | user_id_match = re.search(r'var user_id\s*=\s*(\d+);', response.text)
253 | user_uuid_match = re.search(r'var user_uuid\s*=\s*"(.*?)";', response.text)
254 | user_country_match = re.search(r'var user_country\s*=\s*"(.*?)";', response.text)
255 | login_id_match = re.search(r'var login_id\s*=\s*(\d+);', response.text)
256 | authorization_token_match = re.search(r'"token"\s*:\s*"([^"]+)"', response.text)
257 |
258 | user_id = int(user_id_match.group(1)) if user_id_match else None
259 | user_uuid = user_uuid_match.group(1) if user_uuid_match else None
260 | user_country = user_country_match.group(1) if user_country_match else "IN"
261 | login_id = int(login_id_match.group(1)) if login_id_match else None
262 | token_value = authorization_token_match.group(1) if authorization_token_match else None
263 |
264 | return user_id, user_uuid, user_country, login_id, token_value
265 |
266 | def extract_promo_key(self, user_id: int, user_uuid: str, user_country: str, login_id: int, token_value: str, tries: int = 1) -> bool:
267 | if tries > RETRIES:
268 | raise Exception(f"Failed to extract promo after {RETRIES} tries | {self.email}.")
269 |
270 | params = {
271 | "giveaway_uuid": "df863897-304c-4985-830c-56414830ade7",
272 | "api_key": "a75eb2f0-3f7a-4742-96c7-202977acb4cf",
273 | "user_uuid": user_uuid,
274 | "recaptcha_token": Utils.solve_recaptcha(self.user_agent, "getkey"),
275 | "extra_info": json.dumps({
276 | "siteId": 7,
277 | "siteGroupId": 1,
278 | "loginId": login_id,
279 | "countryCode": user_country,
280 | "userId": user_id
281 | })
282 | }
283 | self.key_headers["Authorization"] = token_value
284 |
285 | try:
286 | response = self.session.get("https://giveawayapi.alienwarearena.com/production/key/get", headers=self.key_headers, params=params)
287 | except TLSClientExeption:
288 | return self.extract_promo_key(user_id, user_uuid, user_country, login_id, token_value, tries + 1)
289 |
290 | if response.status_code == 200:
291 | return True
292 | else:
293 | raise Exception(f"Failed to get promo key | {self.email} | " + response.json()["errorMessage"] if "errorMessage" in response.text else response.json()["message"])
294 |
295 | def get_promo_key(self, tries: int = 1) -> str:
296 | if tries > RETRIES:
297 | raise Exception(f"Failed to get promo key after {RETRIES} tries | {self.email}.")
298 |
299 | try:
300 | response = self.session.get("https://in.alienwarearena.com/giveaways/keys", headers=self.request_headers)
301 | except TLSClientExeption:
302 | return self.get_promo_key(tries + 1)
303 |
304 | if response.status_code == 200:
305 | try:
306 | return response.json()[0]["value"]
307 | except IndexError:
308 | raise Exception(f"Failed to get promo code | {self.email}.")
309 | else:
310 | raise Exception(f"Failed to get promo code | {self.email}.")
311 |
312 | def generate_promo(self, thread_id: int) -> None:
313 | global END
314 |
315 | try:
316 | self.register_account()
317 | Logger.info(
318 | f"[{thread_id}] Successfully created account | {self.email}."
319 | )
320 | time.sleep(1)
321 | verification_link = Utils.extract_verification_link(
322 | user=self.email.split("@")[0],
323 | domain=self.email.split("@")[1]
324 | )
325 | if not verification_link:
326 | raise Exception(f"Failed to get verification link | {self.email}.")
327 |
328 | self.verify_email(verification_link)
329 |
330 | Logger.info(
331 | f"[{thread_id}] Successfully verified account | {self.email}."
332 | )
333 | self.set_password()
334 | self.complete_profile()
335 |
336 | Logger.info(
337 | f"[{thread_id}] Successfully completed account profile | {self.email}."
338 | )
339 |
340 | user_id, user_uuid, user_country, login_id, token_value = self.get_promo_details()
341 | self.extract_promo_key(user_id, user_uuid, user_country, login_id, token_value)
342 | key = self.get_promo_key()
343 |
344 | Logger.info(
345 | f"[{thread_id}] Successfully created promo code | {key}."
346 | )
347 |
348 | THREAD_LOCK.acquire()
349 | with open("promos.txt", "a") as f:
350 | f.write(
351 | f"https://promos.discord.gg/{key}\n"
352 | )
353 | THREAD_LOCK.release()
354 | Data.generated += 1
355 |
356 | except Exception as e:
357 | if "NoKeysLeftInPoolError" in str(e):
358 | END = True
359 |
360 | Logger.error(
361 | f"[{thread_id}] {str(e)}"
362 | )
363 |
364 |
365 | if __name__ == "__main__":
366 |
367 | def create_promo(thread_id: int) -> None:
368 | Logger.info(
369 | f"[{thread_id}] Started task."
370 | )
371 | GeneratePromo().generate_promo(thread_id)
372 |
373 | threading.Thread(target=Utils.set_title).start()
374 |
375 | thread_amount = int(input(Logger.inp("Thread Amount: ")))
376 | print()
377 |
378 | while not END:
379 | threads = []
380 | for i in range(thread_amount):
381 | t = threading.Thread(target=create_promo, args=(i + 1, ))
382 | threads.append(t)
383 |
384 | for thread in threads:
385 | thread.start()
386 |
387 | for thread in threads:
388 | thread.join()
389 |
390 | print()
391 | Logger.info(
392 | "[W] Finished all threads. Waiting for 3 seconds to start more threads."
393 | )
394 | time.sleep(3)
395 | print()
396 |
397 | else:
398 | print()
399 | Logger.error(
400 | "[END] Ended creator due to no stock of promo keys."
401 | )
402 |
--------------------------------------------------------------------------------
/proxies.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixens/Alienware-Promo-Generator/b4218d4b0cfa37ed204dfc6dfe3190a9dbf9da94/proxies.txt
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | names
2 | pyyaml
3 | requests
4 | beautifulsoup4
5 | colorama
6 | tls-client
7 | typing-extensions
8 |
--------------------------------------------------------------------------------