Merge pull request 'feat(cli): add page argument to start scraping from a specific page' (#8) from ErrorNoInternet/r34-scraper:add-page-arg into main

Reviewed-on: https://git.javalsai.dynv6.net/danmax/r34-scraper/pulls/8
This commit is contained in:
danmax 2024-10-20 06:17:35 +02:00
commit 08ed5e51f2
2 changed files with 6 additions and 2 deletions

View File

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

View File

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