-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmytt
More file actions
executable file
·25 lines (20 loc) · 757 Bytes
/
mytt
File metadata and controls
executable file
·25 lines (20 loc) · 757 Bytes
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
#!/opt/homebrew/bin/python3.11
import requests
import erpcreds
import webbrowser
import iitkgp_erp_login.erp as erp
headers = {
'timeout': '20',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36',
}
session = requests.Session()
ERP_TIMETABLE_URL = "https://erp.iitkgp.ac.in/Acad/student/view_stud_time_table.jsp"
_, ssoToken = erp.login(headers, session, ERPCREDS=erpcreds, OTP_CHECK_INTERVAL=2, LOGGING=True, SESSION_STORAGE_FILE=".erp_session")
data = {
"ssoToken": ssoToken,
"module_id": '16',
"menu_id": '40',
}
session.post(url=ERP_TIMETABLE_URL, data=data)
url = f"{ERP_TIMETABLE_URL}?ssoToken={ssoToken}"
webbrowser.open(url)