From 4a5959fd58d9c063ea9a37089d0aaa01c23544bc Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Wed, 10 Apr 2024 11:12:48 +0200 Subject: [PATCH] Fix personal desktop crawling without favorites --- CHANGELOG.md | 1 + PFERD/crawl/ilias/kit_ilias_html.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36768b0..5212824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ ambiguous situations. ### Fixed - Crawling of personal desktop with ILIAS 8 +- Crawling of empty personal desktops ## 3.5.1 - 2024-04-09 diff --git a/PFERD/crawl/ilias/kit_ilias_html.py b/PFERD/crawl/ilias/kit_ilias_html.py index 0be6448..aa00a87 100644 --- a/PFERD/crawl/ilias/kit_ilias_html.py +++ b/PFERD/crawl/ilias/kit_ilias_html.py @@ -1074,6 +1074,14 @@ class IliasPage: if soup.find("a", attrs={"href": lambda x: x and "block_type=pditems" in x}): return True + # Empty personal desktop has zero (0) markers. Match on the text... + if alert := soup.select_one(".alert-info"): + text = alert.getText().lower() + if "you have not yet selected any favourites" in text: + return True + if "sie haben aktuell noch keine favoriten ausgewählt" in text: + return True + # Video listing embeds do not have complete ILIAS html. Try to match them by # their video listing table video_table = soup.find(