From eac2e341612461987d37314110c3f4c7640499f3 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 7 Jan 2022 23:32:31 +0100 Subject: [PATCH] Fix is_logged_in for ILIAS 7 --- PFERD/crawl/ilias/kit_ilias_web_crawler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PFERD/crawl/ilias/kit_ilias_web_crawler.py b/PFERD/crawl/ilias/kit_ilias_web_crawler.py index c6115f4..c5b2953 100644 --- a/PFERD/crawl/ilias/kit_ilias_web_crawler.py +++ b/PFERD/crawl/ilias/kit_ilias_web_crawler.py @@ -611,9 +611,10 @@ instance's greatest bottleneck. @staticmethod def _is_logged_in(soup: BeautifulSoup) -> bool: # Normal ILIAS pages - userlog = soup.find("li", {"id": "userlog"}) - if userlog is not None: - return True + mainbar: Optional[Tag] = soup.find(class_="il-maincontrols-metabar") + if mainbar is not None: + login_button = mainbar.find("button", attrs={"data-action": lambda x: x and "login.php" in x}) + return not login_button # Video listing embeds do not have complete ILIAS html. Try to match them by # their video listing table video_table = soup.find(