wulkanowy-web/app/API/timetable.py

14 lines
430 B
Python
Raw Normal View History

2020-12-02 15:38:03 +01:00
import json
import requests
from bs4 import BeautifulSoup
2021-02-05 20:22:24 +01:00
from .generate_cookies import autogenerate_cookies
2020-12-02 15:38:03 +01:00
2021-02-05 20:12:07 +01:00
def get_timetable(register_id, students, oun, s, date):
2021-02-05 20:22:24 +01:00
cookies = autogenerate_cookies(students, s)
2021-01-09 22:43:21 +01:00
2021-02-05 20:22:24 +01:00
with open('app/API/headers.json') as f:
headers = json.load(f)
2021-01-09 22:43:21 +01:00
timetable = requests.post(oun+'/PlanZajec.mvc/Get', headers=headers, cookies=cookies, json={'data': date})
return timetable.json()