EdupageAPI / edupage-api

A python library for accessing your Edupage account
https://edupageapi.github.io/edupage-api/
GNU General Public License v3.0
67 stars 13 forks source link

Edupage timetable doesn't work #7

Closed DominikDolezel closed 3 years ago

DominikDolezel commented 3 years ago

This is my code, I blurred the credentials.

from edupage_api import Edupage
from datetime import datetime

EDUPAGE_USERNAME = '###'
EDUPAGE_PASSWORD = '###'

edupage = Edupage(EDUPAGE_USERNAME, EDUPAGE_PASSWORD)
edupage.login()
print("Logged in as: " + edupage.username)

dates = edupage.get_available_timetable_dates()

print(dates)

It's weird, because edupage.login() returns my correct username. I tried other functions working with timetables, they don't work as well. On the other hand, I used the homework function in my other project and that worked correctly. By the way, in the section 'Get lesson for a given time' in your description (neither that works for me, unfortunately) you are using EduDate.today(), but I looked into your code, and this function is not defined in this class, actually, it isn't anywhere in dates.py but I believe that EduTime.now() does the same thing. Thanks in advance. Anyway, a good and useful project, keep it up!

ivanhrabcak commented 3 years ago

Hey, thanks for pinpointing the mistakes in my shitty documentation (a967e10)! Does it throw an error or does it just return None?

DominikDolezel commented 3 years ago

Hi, it just returns None.

ivanhrabcak commented 3 years ago

Edupage.login returns True if you successfully log in. Does it return True or False? If you successfully logged in, I can add some debug prints in the future to see where the method returned to find the issue.

DominikDolezel commented 3 years ago

Oh, I now feel so stupid. So because I'm basically logging onto portal.edupage.org and not my school site, the original username the school gave me doesn't work, so I have to use my personal account name, in my case, email. You could maybe point that out in your documentation so that people don't mess this up in the future. So I logged in with my email and now it works, no problem. Thanks very much anyway, and I'm sorry, this was my mistake.

ivanhrabcak commented 3 years ago

No problem. To be honest, I don't know how the login system works. In my case I don't use email but my username. I will add that to the documentation though.

Thank you