mirror of
https://github.com/FliegendeWurst/KIT-ILIAS-downloader.git
synced 2024-08-28 04:04:18 +00:00
Add command-line option to download all courses
This commit is contained in:
parent
d063abc08e
commit
8906069a67
@ -83,6 +83,10 @@ pub struct Opt {
|
|||||||
/// Attempt to re-use session cookies
|
/// Attempt to re-use session cookies
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pub keep_session: bool,
|
pub keep_session: bool,
|
||||||
|
|
||||||
|
/// Download all courses
|
||||||
|
#[structopt(long)]
|
||||||
|
pub all: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static LOG_LEVEL: AtomicUsize = AtomicUsize::new(0);
|
pub static LOG_LEVEL: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
@ -160,9 +160,14 @@ async fn real_main(mut opt: Opt) -> Result<()> {
|
|||||||
PROGRESS_BAR.set_message("initializing..");
|
PROGRESS_BAR.set_message("initializing..");
|
||||||
}
|
}
|
||||||
|
|
||||||
let sync_url = ilias.opt.sync_url.as_deref().unwrap_or(DEFAULT_SYNC_URL);
|
let sync_url = if ilias.opt.all {
|
||||||
|
// change on ILIAS update
|
||||||
|
format!("{}ilias.php?cmdClass=ilmembershipoverviewgui&cmdNode=iy&baseClass=ilmembershipoverviewgui", ILIAS_URL)
|
||||||
|
} else {
|
||||||
|
ilias.opt.sync_url.as_deref().unwrap_or(DEFAULT_SYNC_URL).to_owned()
|
||||||
|
};
|
||||||
let obj = Object::from_url(
|
let obj = Object::from_url(
|
||||||
URL::from_href(sync_url).context("invalid sync URL")?,
|
URL::from_href(&sync_url).context("invalid sync URL")?,
|
||||||
String::new(),
|
String::new(),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user