This commit is contained in:
lychang
2024-01-12 03:27:04 +08:00
parent daa46336f1
commit eb2547e1c6
2 changed files with 82 additions and 6 deletions

26
src/main.rs Normal file
View File

@@ -0,0 +1,26 @@
use std::thread;
use std::time::Duration;
mod file;
mod web_parser;
fn main() {
let mut continue_flag = true;
let mut idx: i32 = 1;
while continue_flag {
let name = web_parser::get_title(idx);
if name == "" {
continue_flag = false;
} else {
web_parser::download_images(idx, &name);
}
thread::sleep(Duration::from_millis(300));
idx += 1;
if idx > 3 {
continue_flag = false;
}
}
}