File size: 1,994 Bytes
5161c7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import datetime


def get_current_time() -> str:
    return datetime.datetime.now(datetime.timezone.utc).strftime("%c GMT")


def get_login_payload(

    csrf_token: str, username: str, password: str, captcha: str

) -> dict:
    return {
        "_csrf": csrf_token,
        "username": username,
        "password": password,
        "captchaStr": captcha,
    }


def get_profile_payload(username: str, csrf: str) -> dict:
    return {
        "verifyMenu": "true",
        "authorizedID": username,
        "_csrf": csrf,
        "nocache": "@(new Date().getTime()",
    }


def get_timetable_payload(username: str, semID: str, csrf: str) -> dict:
    return {
        "_csrf": csrf,
        "semesterSubId": semID,
        "authorizedID": username,
        "x": get_current_time(),
    }


def get_attendance_payload(username: str, semID: str, csrf: str) -> dict:
    return get_timetable_payload(username, semID, csrf)


def get_attendance_semID_list_payload(username: str, csrf: str) -> dict:
    return get_profile_payload(username, csrf)


def get_attendance_detail_payload(

    csrf: str, semID: str, username: str, courseID: str, courseType: str

) -> dict:
    return {
        "_csrf": csrf,
        "semesterSubId": semID,
        "registerNumber": username,
        "courseId": courseID,
        "courseType": courseType,
        "authorizedID": username,
        "x": get_current_time(),
    }


def get_doMarks_view_payload(username: str, semID: str, csrf: str) -> dict:
    return {"authorizedID": username, "semesterSubId": semID, "_csrf": csrf}


def get_gradeHistory_payload(username: str, csrf: str) -> dict:
    return get_profile_payload(username, csrf)


def get_examSchedule_payload(username: str, semID: str, csrf: str) -> dict:
    return get_doMarks_view_payload(username, semID, csrf)


def get_goto_page_payload(username: str, csrf: str) -> dict:
    return get_profile_payload(username, csrf)