mirror of
https://github.com/FliegendeWurst/KIT-ILIAS-downloader.git
synced 2024-08-28 04:04:18 +00:00
Extract url out of web link HEAD request errors
This commit is contained in:
parent
449d642bf5
commit
b9446c0dfa
@ -455,8 +455,13 @@ fn process(ilias: Arc<ILIAS>, mut path: PathBuf, obj: Object) -> impl Future<Out
|
||||
log!(2, "Skipping download, link exists already");
|
||||
return Ok(());
|
||||
}
|
||||
let head = ilias.client.head(&url.url).send().await.context("HEAD request failed")?;
|
||||
let url = head.url().as_str();
|
||||
let head_req_result = ilias.client.head(&url.url).send().await;
|
||||
let url = match &head_req_result {
|
||||
Err(e) => {
|
||||
e.url().context("HEAD request failed")?.as_str()
|
||||
},
|
||||
Ok(head) => head.url().as_str()
|
||||
};
|
||||
if url.starts_with(ILIAS_URL) {
|
||||
// is a link list
|
||||
if fs::metadata(&path).await.is_err() {
|
||||
|
Loading…
Reference in New Issue
Block a user