Correctly crawl files on desktop

The files on the desktop do not include a download link, so we need to
rewrite it.
This commit is contained in:
I-Al-Istannen 2022-01-08 19:59:42 +01:00
parent eb4de8ae0c
commit 43c5453e10

View File

@ -176,6 +176,11 @@ class IliasPage:
continue continue
log.explain(f"Found {name!r}") log.explain(f"Found {name!r}")
if type == IliasElementType.FILE and "_download" not in url:
url = re.sub(r"(target=file_\d+)", r"\1_download", url)
log.explain("Rewired file URL to include download part")
items.append(IliasPageElement(type, url, name)) items.append(IliasPageElement(type, url, name))
return items return items