diff options
Diffstat (limited to 'management')
-rw-r--r-- | management/commands/_private.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/management/commands/_private.py b/management/commands/_private.py index 3b6a164..943a3fb 100644 --- a/management/commands/_private.py +++ b/management/commands/_private.py @@ -23,6 +23,7 @@ from edt.models import Group, Room, Course from edt.utils import get_week import requests +import edt def add_time(date, time): ptime = datetime.datetime.strptime(time, "%H:%M") @@ -194,7 +195,8 @@ def get_weeks(soup): return weeks def get_xml(url): - req = requests.get(url) + user_agent = "celcatsanitizer/" + edt.VERSION + req = requests.get(url, headers={"User-Agent": user_agent}) req.encoding = "utf8" soup = BeautifulSoup(req.content, "html.parser") |