sameerbanchhor-work's picture
download
raw
4.62 kB
import requests
from bs4 import BeautifulSoup
import json
AJAX_URL = "https://durg.ucanapply.com/get-result-details"
REGULAR_BATCHES_FILE = "regular_private_batches.json"
with open(REGULAR_BATCHES_FILE, 'r', encoding='utf-8') as f:
batches = json.load(f)
batch_map = {b['tt_value']: b for b in batches}
def get_session(url):
s = requests.Session()
s.headers.update({
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/120.0.0.0 Safari/537.36'
})
r = s.get(url, timeout=15)
soup = BeautifulSoup(r.text, 'html.parser')
token = soup.find('input', {'name': '_token'})['value']
payload = {
'COURSECD': soup.find('input', {'name': 'COURSECD'})['value'],
'SEMCODE': soup.find('input', {'name': 'SEMCODE'})['value'],
'RESULTTYPE': soup.find('input', {'name': 'RESULTTYPE'})['value'],
'session': soup.find('input', {'name': 'session'})['value'],
'tcc': soup.find('input', {'name': 'tcc'})['value'],
'p1': '', 'all': ''
}
return s, payload, token
def test_roll(session, payload, token, url, roll):
headers = {
'X-Requested-With': 'XMLHttpRequest',
'X-CSRF-TOKEN': token,
'Referer': url,
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
data = payload.copy()
data['EXAMROLLNUMBER'] = str(roll)
data['_token'] = token
try:
r = session.post(AJAX_URL, data=data, headers=headers, timeout=5)
if r.status_code == 200:
rj = r.json()
if 'html' in rj and len(rj['html']) > 200 and 'No Record Found' not in rj['html']:
return True
except Exception:
pass
return False
# Target probes per TR based on verified structures
probes = {
"TR00000001": [ # B.A.-B.Ed Part I
"9369144001", "93691440001", "18369144001", "19369144001", "9370144001", "18370144001",
"9369144002", "9369144005", "19369144005", "9374144001", "9358144001"
],
"TR00000002": [ # B.Sc.-B.Ed Part I
"9370137001", "93701370001", "18370137001", "19370137001", "9369137001", "18369137001",
"9370137003", "93701370003", "9374137001", "9358137001"
],
"TR00000004": [ # MSW Sem 1
"18331125001", "33118125001", "18303125001", "30318125001", "18334125001", "33418125001",
"18339125001", "33918125001", "18340125001", "34018125001", "18341125001", "34118125001"
],
"TR00000005": [ # MSW Sem 3
"17331125001", "33117125001", "17303125001", "30317125001", "17334125001", "33417125001",
"17339125001", "33917125001", "17340125001", "34017125001", "17341125001", "34117125001"
],
"TR00000006": [ # MS Lib I Sc Sem 1
"18331121001", "33118121001", "18303121001", "30318121001", "18334121001", "33418121001",
"18339121001", "33918121001"
],
"TR00000007": [ # B.Ed Sem 1
"18335029001", "33518029001", "18305029001", "30518029001", "18307029001", "30718029001",
"18341029001", "34118029001", "18351029001", "35118029001", "18352029001", "35218029001",
"18358029001", "35818029001", "18366029001", "36618029001", "18369029001", "36918029001",
"18374029001", "37418029001", "18381029001", "38118029001", "18386029001", "38618029001"
],
"TR00000008": [ # B.Ed Sem 3
"17335029001", "33517029001", "17305029001", "30517029001", "17307029001", "30717029001",
"17341029001", "34117029001", "17351029001", "35117029001", "17352029001", "35217029001",
"17358029001", "35817029001", "17366029001", "36617029001", "17369029001", "36917029001",
"17374029001", "37417029001", "17381029001", "38117029001", "17386029001", "38617029001",
"21335029189", "17335029189"
],
"TR00000009": [ # M.Sc Bio Tech Sem 1
"18331089001", "33118089001", "18334089001", "33418089001", "18338089001", "33818089001",
"18339089001", "33918089001", "18341089001", "34118089001"
],
"TR00000010": [ # M.Sc Bio Tech Sem 3
"17331089001", "33117089001", "17334089001", "33417089001", "17338089001", "33817089001",
"17339089001", "33917089001", "17341089001", "34117089001"
]
}
print("Running targeted roll probes...")
for tr, roll_list in probes.items():
if tr not in batch_map:
print(f"{tr}: Unpublished / Missing")
continue
b = batch_map[tr]
session, payload, token = get_session(b['link'])
hits = []
for r in roll_list:
if test_roll(session, payload, token, b['link'], r):
hits.append(r)
print(f"{tr} ({b['description'][:50]}...): HITS = {hits}")

Xet Storage Details

Size:
4.62 kB
·
Xet hash:
2380fafbc96c83634fe299e2a9d8f32ec6c3d5bff831eb3e0ead73aa0f4f93ae

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.