|
21 | 21 | 'name': 'Riding Extreme 3D',
|
22 | 22 | 'appToken': 'd28721be-fd2d-4b45-869e-9f253b554e50',
|
23 | 23 | 'promoId': '43e35910-c168-4634-ad4f-52fd764a843f',
|
| 24 | + 'timing': 25000 / 1000, # in seconds |
| 25 | + 'attempts': 25, |
24 | 26 | },
|
25 | 27 | 2: {
|
26 | 28 | 'name': 'Chain Cube 2048',
|
27 | 29 | 'appToken': 'd1690a07-3780-4068-810f-9b5bbf2931b2',
|
28 | 30 | 'promoId': 'b4170868-cef0-424f-8eb9-be0622e8e8e3',
|
| 31 | + 'timing': 25000 / 1000, |
| 32 | + 'attempts': 20, |
29 | 33 | },
|
30 | 34 | 3: {
|
31 | 35 | 'name': 'My Clone Army',
|
32 | 36 | 'appToken': '74ee0b5b-775e-4bee-974f-63e7f4d5bacb',
|
33 | 37 | 'promoId': 'fe693b26-b342-4159-8808-15e3ff7f8767',
|
| 38 | + 'timing': 180000 / 1000, |
| 39 | + 'attempts': 30, |
34 | 40 | },
|
35 | 41 | 4: {
|
36 | 42 | 'name': 'Train Miner',
|
37 | 43 | 'appToken': '82647f43-3f87-402d-88dd-09a90025313f',
|
38 | 44 | 'promoId': 'c4480ac7-e178-4973-8061-9ed5b2e17954',
|
| 45 | + 'timing': 20000 / 1000, |
| 46 | + 'attempts': 15, |
39 | 47 | },
|
40 | 48 | 5: {
|
41 | 49 | 'name': 'Merge Away',
|
42 | 50 | 'appToken': '8d1cc2ad-e097-4b86-90ef-7a27e19fb833',
|
43 |
| - 'promoId': 'dc128d28-c45b-411c-98ff-ac7726fbaea4' |
| 51 | + 'promoId': 'dc128d28-c45b-411c-98ff-ac7726fbaea4', |
| 52 | + 'timing': 20000 / 1000, |
| 53 | + 'attempts': 25, |
44 | 54 | },
|
45 | 55 | 6: {
|
46 | 56 | 'name': 'Twerk Race 3D',
|
47 | 57 | 'appToken': '61308365-9d16-4040-8bb0-2f4a4c69074c',
|
48 |
| - 'promoId': '61308365-9d16-4040-8bb0-2f4a4c69074c' |
| 58 | + 'promoId': '61308365-9d16-4040-8bb0-2f4a4c69074c', |
| 59 | + 'timing': 20000 / 1000, |
| 60 | + 'attempts': 20, |
49 | 61 | }
|
50 | 62 | }
|
51 | 63 |
|
52 |
| -EVENTS_DELAY = 20000 / 1000 # converting milliseconds to seconds |
53 |
| - |
54 | 64 |
|
55 | 65 | async def load_proxies(file_path):
|
56 | 66 | try:
|
@@ -124,21 +134,21 @@ async def generate_key(client_token, promo_id, proxies):
|
124 | 134 | return data['promoCode']
|
125 | 135 |
|
126 | 136 |
|
127 |
| -async def generate_key_process(app_token, promo_id, proxies): |
| 137 | +async def generate_key_process(app_token, promo_id, proxies, timing, attempts): |
128 | 138 | client_id = await generate_client_id()
|
129 | 139 | logger.info(f"Generated client ID: {client_id}")
|
130 | 140 | client_token = await login(client_id, app_token, proxies)
|
131 | 141 | if not client_token:
|
132 | 142 | logger.error(f"Failed to generate client token for client ID: {client_id}")
|
133 | 143 | return None
|
134 | 144 |
|
135 |
| - for i in range(25): |
136 |
| - logger.info(f"Emulating progress event {i + 1}/11 for client ID: {client_id}") |
137 |
| - await asyncio.sleep(EVENTS_DELAY * (random.random() / 3 + 1)) |
| 145 | + for i in range(attempts): |
| 146 | + logger.info(f"Emulating progress event {i + 1}/{attempts} for client ID: {client_id}") |
| 147 | + await asyncio.sleep(timing * (random.random() / 3 + 1)) |
138 | 148 | try:
|
139 | 149 | has_code = await emulate_progress(client_token, promo_id, proxies)
|
140 | 150 | except httpx.HTTPStatusError:
|
141 |
| - logger.warning(f"Event {i + 1}/15 failed for client ID: {client_id}") |
| 151 | + logger.warning(f"Event {i + 1}/{attempts} failed for client ID: {client_id}") |
142 | 152 | continue
|
143 | 153 |
|
144 | 154 | if has_code:
|
@@ -170,7 +180,16 @@ async def main(game_choice, key_count, proxies):
|
170 | 180 |
|
171 | 181 | spinner = asyncio.create_task(spinner_task()) # Start the spinner task
|
172 | 182 |
|
173 |
| - tasks = [generate_key_process(game['appToken'], game['promoId'], proxies) for _ in range(key_count)] |
| 183 | + tasks = [ |
| 184 | + generate_key_process( |
| 185 | + game['appToken'], |
| 186 | + game['promoId'], |
| 187 | + proxies, |
| 188 | + game['timing'], |
| 189 | + game['attempts'] |
| 190 | + ) |
| 191 | + for _ in range(key_count) |
| 192 | + ] |
174 | 193 | keys = await asyncio.gather(*tasks)
|
175 | 194 |
|
176 | 195 | spinner.cancel() # Stop the spinner task
|
|
0 commit comments