7 Commits

4 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "r34-scraper" name = "r34-scraper"
version = "0.1.0" version = "1.0.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

2
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"

View File

@@ -14,8 +14,12 @@ pub struct Args {
#[arg(short, long, required = true)] #[arg(short, long, required = true)]
pub tags: Vec<String>, pub tags: Vec<String>,
/// Page to start scraping from
#[arg(short, long, default_value_t = 1)]
pub page: usize,
/// Async jobs to use for fetching /// Async jobs to use for fetching
#[arg(short, long, default_value = "4")] #[arg(short, long, default_value_t = 4)]
pub jobs: usize, pub jobs: usize,
/// Delay for rate-limits (ms) /// Delay for rate-limits (ms)

View File

@@ -25,7 +25,7 @@ async fn main() -> ExitCode {
.build() .build()
.unwrap(); .unwrap();
for page in 0.. { for page in args.page - 1.. {
println!("now scraping page {}", page + 1); println!("now scraping page {}", page + 1);
println!( println!(
"https://rule34.xxx/index.php?page=post&s=list&tags={uri_tags}&pid={}", "https://rule34.xxx/index.php?page=post&s=list&tags={uri_tags}&pid={}",