2021-02-02 22:19:29 +01:00
|
|
|
import json
|
|
|
|
import requests
|
2021-02-02 23:49:14 +01:00
|
|
|
from .generate_cookies import autogenerate_cookies
|
2021-02-02 22:19:29 +01:00
|
|
|
|
|
|
|
def get_partial(register_id, students, oun, s):
|
2021-02-02 23:45:42 +01:00
|
|
|
cookies = autogenerate_cookies(students, s)
|
|
|
|
|
|
|
|
with open('app/API/headers.json') as f:
|
|
|
|
headers = json.load(f)
|
2021-02-02 22:19:29 +01:00
|
|
|
|
|
|
|
partial = requests.post(oun+'/Statystyki.mvc/GetOcenyCzastkowe', headers=headers, cookies=cookies, json={'idOkres': register_id})
|
|
|
|
|
|
|
|
return partial.json()
|
|
|
|
|
|
|
|
def get_year(register_id, students, oun, s):
|
2021-02-02 23:45:42 +01:00
|
|
|
|
|
|
|
cookies = autogenerate_cookies(students, s)
|
2021-02-02 22:19:29 +01:00
|
|
|
|
2021-02-02 23:45:42 +01:00
|
|
|
with open('app/API/headers.json') as f:
|
|
|
|
headers = json.load(f)
|
2021-02-02 22:19:29 +01:00
|
|
|
|
|
|
|
year = requests.post(oun+'/Statystyki.mvc/GetOcenyRoczne', headers=headers, cookies=cookies, json={'idOkres': register_id})
|
|
|
|
|
|
|
|
return year.json()
|