G

jetter

public
Guest Nov 05, 2024 Never 17
Clone
Plaintext paste1.txt 80 lines (65 loc) | 3.15 KB
1
import requests
2
from concurrent.futures import ThreadPoolExecutor, as_completed
3
4
# Base URL
5
base_url = "https://server-production-b174.up.railway.app/api"
6
7
# List of Telegram IDs
8
telegram_ids = [653003666, 6395417872, 7498604910, 5093265374, 7269011692, 6668885507]
9
10
# Common Headers
11
headers = {
12
"Content-Type": "application/json",
13
"Accept": "*/*",
14
"Accept-Encoding": "gzip, deflate, br, zstd",
15
"Accept-Language": "en-US,en;q=0.9",
16
"Origin": "https://client-phi-pied-10.vercel.app",
17
"Referer": "https://client-phi-pied-10.vercel.app/",
18
"Sec-CH-UA": '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
19
"Sec-CH-UA-Mobile": "?0",
20
"Sec-CH-UA-Platform": '"Windows"',
21
"Sec-Fetch-Dest": "empty",
22
"Sec-Fetch-Mode": "cors",
23
"Sec-Fetch-Site": "cross-site",
24
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
25
}
26
27
def process_telegram_id(telegram_id):
28
print(f"\nProcessing Telegram ID: {telegram_id}")
29
30
# Login Request
31
login_url = f"{base_url}/auth/login"
32
login_payload = {"telegramId": telegram_id}
33
login_response = requests.post(login_url, json=login_payload, headers=headers)
34
login_data = login_response.json()
35
36
# Print only coin and username from login response
37
if login_response.status_code == 200 and 'user' in login_data:
38
coin_value = login_data['user'].get('coin', 'N/A')
39
username_id = login_data['user'].get('username', 'N/A')
40
print(f"Login Successful:\nCoin: {coin_value}\nUsername: {username_id}")
41
else:
42
print("Login failed or 'user' data not found.")
43
44
# Claim Hourly Reward Request
45
reward_url = f"{base_url}/rew/claim-hourly-reward"
46
reward_response = requests.post(reward_url, json=login_payload, headers=headers)
47
print("Claim Hourly Reward Status Code:", reward_response.status_code)
48
print("Claim Hourly Reward Response JSON:", reward_response.json())
49
50
# Task Completion Request (Loop until 404)
51
task_url = f"{base_url}/task/complete-task"
52
task_id_number = 1
53
54
while True:
55
task_payload = {
56
"telegramId": telegram_id,
57
"taskId": f"task{task_id_number}"
58
}
59
60
task_response = requests.post(task_url, json=task_payload, headers=headers)
61
62
# Print Task Response
63
print(f"Task ID: task{task_id_number}")
64
print("Task Completion Status Code:", task_response.status_code)
65
print("Task Completion Response JSON:", task_response.json())
66
67
# Break if Status Code is 404
68
if task_response.status_code == 404:
69
print("No more tasks to complete for this Telegram ID. Exiting loop.")
70
break
71
72
# Increment task_id_number for the next request
73
task_id_number += 1
74
75
# Execute all tasks concurrently for each telegram_id
76
with ThreadPoolExecutor(max_workers=len(telegram_ids)) as executor:
77
futures = [executor.submit(process_telegram_id, telegram_id) for telegram_id in telegram_ids]
78
79
for future in as_completed(futures):
80
future.result() # Wait for each thread to complete