mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Implement ILIAS auth and crawl home page
This commit introduces the necessary machinery to authenticate with ILIAS and crawl the home page. It can't do much yet and just silently fetches the homepage.
This commit is contained in:
@ -4,6 +4,8 @@ import functools
|
||||
import getpass
|
||||
from typing import Any, Callable, Optional, TypeVar
|
||||
|
||||
import bs4
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
@ -23,6 +25,12 @@ async def ainput(prompt: str) -> str:
|
||||
async def agetpass(prompt: str) -> str:
|
||||
return await to_thread(lambda: getpass.getpass(prompt))
|
||||
|
||||
def soupify(data: bytes) -> bs4.BeautifulSoup:
|
||||
"""
|
||||
Parses HTML to a beautifulsoup object.
|
||||
"""
|
||||
|
||||
return bs4.BeautifulSoup(data, "html.parser")
|
||||
|
||||
async def prompt_yes_no(query: str, default: Optional[bool]) -> bool:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user