mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
rename argument torrents_path to storage, infohash_source to infohash_file (reserve namespace for the URL sources)
This commit is contained in:
parent
525a487806
commit
29816f80ef
3 changed files with 16 additions and 16 deletions
16
README.md
16
README.md
|
|
@ -31,12 +31,12 @@ Crawler/aggregation tool for the [Aquatic](https://github.com/greatest-ape/aquat
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
aquatic-crawler --infohash-source /path/to/info-hash-ipv4.json\
|
aquatic-crawler --infohash-file /path/to/info-hash-ipv4.json\
|
||||||
--infohash-source /path/to/info-hash-ipv6.json\
|
--infohash-file /path/to/info-hash-ipv6.json\
|
||||||
--infohash-source /path/to/another-source.json\
|
--infohash-file /path/to/another-source.json\
|
||||||
--torrent-tracker udp://host1:port\
|
--torrent-tracker udp://host1:port\
|
||||||
--torrent-tracker udp://host2:port\
|
--torrent-tracker udp://host2:port\
|
||||||
--torrents-path /path/to/storage
|
--storage /path/to/storage
|
||||||
```
|
```
|
||||||
* all arguments are optional, to support multiple source and target drivers
|
* all arguments are optional, to support multiple source and target drivers
|
||||||
* running without arguments does nothing!
|
* running without arguments does nothing!
|
||||||
|
|
@ -54,13 +54,13 @@ aquatic-crawler --infohash-source /path/to/info-hash-ipv4.json\
|
||||||
-c, --clear
|
-c, --clear
|
||||||
Clear previous index collected on crawl session start
|
Clear previous index collected on crawl session start
|
||||||
|
|
||||||
-i, --infohash-source <INFOHASH_SOURCE>
|
--infohash-file <INFOHASH_FILE>
|
||||||
Filepath(s) to the Aquatic tracker info-hash JSON/API
|
Absolute filename(s) to the Aquatic tracker info-hash JSON/API
|
||||||
|
|
||||||
* PR#233 feature
|
* PR#233 feature
|
||||||
|
|
||||||
--torrents-path <TORRENTS_PATH>
|
--storage <STORAGE>
|
||||||
Directory path to store the `.torrent` files
|
Directory path to store reload data (e.g. `.torrent` files)
|
||||||
|
|
||||||
--torrent-tracker <TORRENT_TRACKER>
|
--torrent-tracker <TORRENT_TRACKER>
|
||||||
Define custom tracker(s) to preload the `.torrent` files info
|
Define custom tracker(s) to preload the `.torrent` files info
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,15 @@ pub struct Argument {
|
||||||
#[arg(short, long, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
pub clear: bool,
|
pub clear: bool,
|
||||||
|
|
||||||
/// Filepath(s) to the Aquatic tracker info-hash JSON/API
|
/// Absolute filename(s) to the Aquatic tracker info-hash JSON/API
|
||||||
///
|
///
|
||||||
/// * PR#233 feature
|
/// * PR#233 feature
|
||||||
#[arg(short, long)]
|
|
||||||
pub infohash_source: Vec<String>,
|
|
||||||
|
|
||||||
/// Directory path to store the `.torrent` files
|
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub torrents_path: Option<String>,
|
pub infohash_file: Vec<String>,
|
||||||
|
|
||||||
|
/// Directory path to store reload data (e.g. `.torrent` files)
|
||||||
|
#[arg(long)]
|
||||||
|
pub storage: Option<String>,
|
||||||
|
|
||||||
/// Define custom tracker(s) to preload the `.torrent` files info
|
/// Define custom tracker(s) to preload the `.torrent` files info
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ async fn main() -> anyhow::Result<()> {
|
||||||
let is_debug_e = argument.debug.contains("e");
|
let is_debug_e = argument.debug.contains("e");
|
||||||
|
|
||||||
// init shared members
|
// init shared members
|
||||||
let torrent_storage = if let Some(t) = argument.torrents_path {
|
let torrent_storage = if let Some(t) = argument.storage {
|
||||||
let s = database::torrent::Storage::init(&t, argument.clear)?;
|
let s = database::torrent::Storage::init(&t, argument.clear)?;
|
||||||
if argument.clear && is_debug_i {
|
if argument.clear && is_debug_i {
|
||||||
debug::info(String::from("Cleanup torrent storage"));
|
debug::info(String::from("Cleanup torrent storage"));
|
||||||
|
|
@ -59,7 +59,7 @@ async fn main() -> anyhow::Result<()> {
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
// collect info-hashes from API
|
// collect info-hashes from API
|
||||||
for source in &argument.infohash_source {
|
for source in &argument.infohash_file {
|
||||||
if is_debug_i {
|
if is_debug_i {
|
||||||
debug::info(format!("Handle info-hash source `{source}`..."));
|
debug::info(format!("Handle info-hash source `{source}`..."));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue