mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Fix is_logged_in for ILIAS 7
This commit is contained in:
parent
a82a0b19c2
commit
eac2e34161
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user