mirror of
https://github.com/FliegendeWurst/KIT-ILIAS-downloader.git
synced 2024-08-28 04:04:18 +00:00
Add CLI flag for forum downloading
This commit is contained in:
parent
84eda01c29
commit
6fea6f2d0f
10
src/main.rs
10
src/main.rs
@ -525,6 +525,9 @@ fn process(ilias: Arc<ILIAS>, path: PathBuf, obj: Object) -> impl std::future::F
|
|||||||
tokio::io::copy(&mut reader, &mut file).await.unwrap();
|
tokio::io::copy(&mut reader, &mut file).await.unwrap();
|
||||||
},
|
},
|
||||||
Forum { url, .. } => {
|
Forum { url, .. } => {
|
||||||
|
if !ilias.opt.forum {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Err(e) = fs::create_dir(&path) {
|
if let Err(e) = fs::create_dir(&path) {
|
||||||
if e.kind() != io::ErrorKind::AlreadyExists {
|
if e.kind() != io::ErrorKind::AlreadyExists {
|
||||||
println!("error: {:?}", e);
|
println!("error: {:?}", e);
|
||||||
@ -573,6 +576,9 @@ fn process(ilias: Arc<ILIAS>, path: PathBuf, obj: Object) -> impl std::future::F
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Thread { url } => {
|
Thread { url } => {
|
||||||
|
if !ilias.opt.forum {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Err(e) = fs::create_dir(&path) {
|
if let Err(e) = fs::create_dir(&path) {
|
||||||
if e.kind() != io::ErrorKind::AlreadyExists {
|
if e.kind() != io::ErrorKind::AlreadyExists {
|
||||||
println!("error: {:?}", e);
|
println!("error: {:?}", e);
|
||||||
@ -640,6 +646,10 @@ struct Opt {
|
|||||||
#[structopt(short, long)]
|
#[structopt(short, long)]
|
||||||
no_videos: bool,
|
no_videos: bool,
|
||||||
|
|
||||||
|
/// Download forum content
|
||||||
|
#[structopt(short = "t", long)]
|
||||||
|
forum: bool,
|
||||||
|
|
||||||
/// Re-download already present files
|
/// Re-download already present files
|
||||||
#[structopt(short)]
|
#[structopt(short)]
|
||||||
force: bool,
|
force: bool,
|
||||||
|
Loading…
Reference in New Issue
Block a user