added back aria2 output
This commit is contained in:
Generated
+1
@@ -1323,6 +1323,7 @@ dependencies = [
|
|||||||
"select",
|
"select",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ reqwest = { version = "0.12", features = ["json"] }
|
|||||||
select = "0.6.1"
|
select = "0.6.1"
|
||||||
serde = "1.0.228"
|
serde = "1.0.228"
|
||||||
serde_json = "1.0.145"
|
serde_json = "1.0.145"
|
||||||
|
time = "0.3.44"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
|||||||
+16
-14
@@ -8,6 +8,7 @@ use serde_json::{json, Value};
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use std::thread;
|
||||||
use tokio::{spawn, sync::Semaphore};
|
use tokio::{spawn, sync::Semaphore};
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
@@ -32,15 +33,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let server_url = "https://api.michijackson.xyz/search/".to_owned();
|
let server_url = "https://api.michijackson.xyz/search/".to_owned();
|
||||||
let mut input = String::new();
|
let mut input = String::new();
|
||||||
|
|
||||||
let _command = Command::new("/usr/bin/aria2c")
|
|
||||||
.arg("--enable-rpc")
|
|
||||||
.arg("--disable-ipv6")
|
|
||||||
.arg("--rpc-listen-all")
|
|
||||||
.arg("--rpc-listen-port=6800")
|
|
||||||
.stdout(std::process::Stdio::null())
|
|
||||||
.stderr(std::process::Stdio::null())
|
|
||||||
.spawn();
|
|
||||||
|
|
||||||
eprint!("Search: ");
|
eprint!("Search: ");
|
||||||
io::stdin()
|
io::stdin()
|
||||||
.read_line(&mut input)
|
.read_line(&mut input)
|
||||||
@@ -80,6 +72,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let _command = Command::new("/usr/bin/aria2c")
|
||||||
|
.arg("--enable-rpc")
|
||||||
|
.arg("--disable-ipv6")
|
||||||
|
.arg("--rpc-listen-all")
|
||||||
|
.arg("--rpc-listen-port=6800")
|
||||||
|
//.arg("--rpc-secret=0")
|
||||||
|
.spawn();
|
||||||
|
|
||||||
|
thread::sleep(std::time::Duration::from_millis(500));
|
||||||
|
|
||||||
aria2_ws(magnet.unwrap()).await;
|
aria2_ws(magnet.unwrap()).await;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -90,11 +92,11 @@ async fn aria2_ws(items: &str) {
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let options = TaskOptions {
|
let options = TaskOptions {
|
||||||
split: Some(2),
|
//split: Some(2),
|
||||||
extra_options: json!({"max-download-limit": "200K"})
|
//extra_options: json!({"max-download-limit": "200K"})
|
||||||
.as_object()
|
// .as_object()
|
||||||
.unwrap()
|
// .unwrap()
|
||||||
.clone(),
|
// .clone(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user