forked from danmax/r34-scraper
Compare commits
7 Commits
cli-args-o
...
javalsai-c
Author | SHA1 | Date | |
---|---|---|---|
a852c8bcc5
|
|||
235e13230b
|
|||
|
bd517ed0b5 | ||
5f848be434 | |||
08ed5e51f2 | |||
3573f6ff5a
|
|||
bcd349e36f
|
@@ -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
2
rust-toolchain.toml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[toolchain]
|
||||||
|
channel = "nightly"
|
@@ -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)
|
||||||
|
@@ -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={}",
|
||||||
|
Reference in New Issue
Block a user