mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-07-20 01:42:37 +02:00
Fix is_logged_in for ILIAS 7
This commit is contained in:
@@ -611,9 +611,10 @@ instance's greatest bottleneck.
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _is_logged_in(soup: BeautifulSoup) -> bool:
|
def _is_logged_in(soup: BeautifulSoup) -> bool:
|
||||||
# Normal ILIAS pages
|
# Normal ILIAS pages
|
||||||
userlog = soup.find("li", {"id": "userlog"})
|
mainbar: Optional[Tag] = soup.find(class_="il-maincontrols-metabar")
|
||||||
if userlog is not None:
|
if mainbar is not None:
|
||||||
return True
|
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
|
# Video listing embeds do not have complete ILIAS html. Try to match them by
|
||||||
# their video listing table
|
# their video listing table
|
||||||
video_table = soup.find(
|
video_table = soup.find(
|
||||||
|
Reference in New Issue
Block a user