mirror of
https://github.com/FliegendeWurst/KIT-ILIAS-downloader.git
synced 2024-08-28 04:04:18 +00:00
Error on expired session
This commit is contained in:
parent
8ea2cae769
commit
daa9bdbfa4
@ -184,6 +184,15 @@ impl ILIAS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_html(&self, url: &str) -> Result<Html> {
|
pub async fn get_html(&self, url: &str) -> Result<Html> {
|
||||||
|
let resp = self.download(url).await?;
|
||||||
|
if resp
|
||||||
|
.url()
|
||||||
|
.query()
|
||||||
|
.map(|x| x.contains("reloadpublic=1") || x.contains("cmd=force_login"))
|
||||||
|
.unwrap_or(false)
|
||||||
|
{
|
||||||
|
return Err(anyhow!("not logged in / session expired"));
|
||||||
|
}
|
||||||
let text = self.download(url).await?.text().await?;
|
let text = self.download(url).await?.text().await?;
|
||||||
let html = Html::parse_document(&text);
|
let html = Html::parse_document(&text);
|
||||||
if html.select(&alert_danger).next().is_some() {
|
if html.select(&alert_danger).next().is_some() {
|
||||||
|
Loading…
Reference in New Issue
Block a user