forked from Aero25x/orbiter-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorbiter_checker.py
137 lines (108 loc) · 4.5 KB
/
orbiter_checker.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import cloudscraper
import json
import threading
from concurrent.futures import ThreadPoolExecutor, as_completed
from random import randint
print("""
_ _ _ _ _ _____ _
| | | (_) | | | | / ____| | |
| |__| |_ __| | __| | ___ _ __ | | ___ __| | ___
| __ | |/ _` |/ _` |/ _ \ '_ \| | / _ \ / _` |/ _ \\
| | | | | (_| | (_| | __/ | | | |___| (_) | (_| | __/
|_| |_|_|\__,_|\__,_|\___|_| |_|\_____\___/ \__,_|\___|
Orbiter Checker by Aero25x
https://t.me/hidden_coding
""")
# Define the URL template
URL_TEMPLATE = "https://api.orbiter.finance/sdk/opoints/user/{}"
# Define the headers
HEADERS = {
"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",
"Accept-Language": "en,en-US;q=0.9,ru;q=0.8",
"Cache-Control": "max-age=0",
"Priority": "u=0, i",
"Sec-CH-UA": r'"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
"Sec-CH-UA-Mobile": "?0",
"Sec-CH-UA-Platform": "\"macOS\"",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
}
# Initialize a thread-safe total_tokens variable
total_tokens = 0.0
total_tokens_lock = threading.Lock()
def read_wallets(file_path: str) -> list:
"""
Reads wallet addresses from a file, trims whitespace, and filters out invalid entries.
"""
try:
with open(file_path, 'r') as file:
wallets = [
line.strip()
for line in file
if line.strip() and len(line.strip()) == 42 and line.strip().startswith("0x")
]
return wallets
except FileNotFoundError:
print(f"Error: The file {file_path} was not found.")
return []
except Exception as e:
print(f"An error occurred while reading {file_path}: {e}")
return []
def process_wallet(wallet: str, scraper: cloudscraper.CloudScraper) -> None:
"""
Processes a single wallet: sends a GET request, parses the response, and updates total_tokens.
"""
global total_tokens
url = URL_TEMPLATE.format(wallet)
try:
response = scraper.get(url, headers=HEADERS, timeout=10)
if response.status_code == 200:
try:
data = response.json()
points = data.get("result", {}).get("points", None)
if isinstance(points, (int, float)):
value = points * 5.5970149254
print(f"[*]{wallet} is eligible (points: {points}, value: {value:.2f})")
with total_tokens_lock:
total_tokens += value
else:
print(f"{wallet}: Unable to fetch points from the response.")
except json.JSONDecodeError:
print(f"{wallet}: Failed to parse JSON response.")
except Exception as e:
print(f"{wallet}: An error occurred while processing the response: {e}")
else:
print(f"Failed to fetch data for wallet {wallet}. HTTP Status: {response.status_code}")
except cloudscraper.exceptions.CloudflareChallengeError:
print(f"{wallet}: Cloudflare challenge encountered.")
except cloudscraper.exceptions.RequestException as e:
print(f"{wallet}: Request failed: {e}")
except Exception as e:
print(f"{wallet}: An unexpected error occurred: {e}")
def main():
wallets = read_wallets("wallets.txt")
if not wallets:
print("No valid wallets to process.")
return
scraper = cloudscraper.create_scraper()
# Use ThreadPoolExecutor to handle concurrency
with ThreadPoolExecutor(max_workers=20) as executor:
futures = {executor.submit(process_wallet, wallet, scraper): wallet for wallet in wallets}
for future in as_completed(futures):
wallet = futures[future]
try:
future.result()
except Exception as e:
print(f"An error occurred while processing wallet {wallet}: {e}")
print("-" * 110)
print(f"[*]Total Tokens: {total_tokens:.2f}")
print("-" * 110)
potential_usd_05 = total_tokens * 0.05
potential_usd_03 = total_tokens * 0.03
# print(f"[*]Potential in USD if $0.05 per token: {potential_usd_05:.2f}$")
# print(f"[*]Potential in USD if $0.03 per token: {potential_usd_03:.2f}$")
if __name__ == "__main__":
main()