-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathres.py
More file actions
64 lines (53 loc) · 1.89 KB
/
Copy pathres.py
File metadata and controls
64 lines (53 loc) · 1.89 KB
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
import requests
import concurrent.futures
import threading
import json
base_number = 1089
base_reg = 4231114411
results = []
lock = threading.Lock()
MAX_RETRIES = 35
def fetch_until_success(number):
delta = number - base_number
reg_no = base_reg + delta
attempts = 0
while attempts < MAX_RETRIES:
params = {
"tag": "wb_12th_result",
"roll": "453211",
"number": str(number),
"registration_no": str(reg_no),
"year": "2025",
"wb_id": "105",
"source": "1"
}
try:
response = requests.get("https://www.fastresult.in/board-results/wbresultapi12/api/get-12th-result", params=params, timeout=5)
try:
data = response.json()
except ValueError:
print(f"[x] Non-JSON response for Number={number}, RegNo={reg_no}")
return
if data.get("status") == "success":
with lock:
results.append({
"number": number,
"reg_no": str(reg_no),
"raw_data": data # store full successful response
})
return
else:
print(f"[-] Invalid: Number={number}, RegNo={reg_no}")
except Exception as e:
print(f"[!] Error: Number={number}, RegNo={reg_no} => {e}")
reg_no += 1
attempts += 1
# Use any number range you'd like
numbers_to_check = list(range(1088, 1300))
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
executor.map(fetch_until_success, numbers_to_check)
# Display everything
for entry in results:
print(f"\n[+] Number: {entry['number']} | RegNo: {entry['reg_no']}")
print(json.dumps(entry["raw_data"], indent=2))
print("=" * 100)