diff --git a/src/mijnbib/login_handlers.py b/src/mijnbib/login_handlers.py index 85a728c..3da2582 100644 --- a/src/mijnbib/login_handlers.py +++ b/src/mijnbib/login_handlers.py @@ -32,7 +32,6 @@ def __init__(self, username, password, url: str, br: mechanize.Browser): self._br = br def login(self) -> mechanize.Browser: - # TODO: check if can be sped up by starting from lidmaatschappen page (and not overview) response = self._log_in() html = response.read().decode("utf-8") if response is not None else "" self._validate_logged_in(html) # raises AuthenticationError if not ok diff --git a/src/mijnbib/mijnbibliotheek.py b/src/mijnbib/mijnbibliotheek.py index 3e48341..ebe7ae4 100644 --- a/src/mijnbib/mijnbibliotheek.py +++ b/src/mijnbib/mijnbibliotheek.py @@ -79,7 +79,12 @@ def login(self) -> None: CanNotConnectError IncompatibleSourceError """ - url = self.BASE_URL + "/mijn-bibliotheek/aanmelden" + url = ( + self.BASE_URL + + "/mijn-bibliotheek/aanmelden" + # loads considerably faster than default "/overzicht" page, especially for cold cache + + "?destination=/mijn-bibliotheek/lidmaatschappen" + ) _log.info(f"Will log in at url : {url}") _log.info(f" with id : {self._username}")