added back aria2 output

This commit is contained in:
2025-11-17 13:01:01 +01:00
parent aa1359bc97
commit aee569906a
3 changed files with 18 additions and 14 deletions
Generated
+1
View File
@@ -1323,6 +1323,7 @@ dependencies = [
"select",
"serde",
"serde_json",
"time",
"tokio",
]
+1
View File
@@ -11,4 +11,5 @@ reqwest = { version = "0.12", features = ["json"] }
select = "0.6.1"
serde = "1.0.228"
serde_json = "1.0.145"
time = "0.3.44"
tokio = { version = "1", features = ["full"] }
+16 -14
View File
@@ -8,6 +8,7 @@ use serde_json::{json, Value};
use std::io;
use std::process::Command;
use std::sync::Arc;
use std::thread;
use tokio::{spawn, sync::Semaphore};
#[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 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: ");
io::stdin()
.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;
Ok(())
@@ -90,11 +92,11 @@ async fn aria2_ws(items: &str) {
.await
.unwrap();
let options = TaskOptions {
split: Some(2),
extra_options: json!({"max-download-limit": "200K"})
.as_object()
.unwrap()
.clone(),
//split: Some(2),
//extra_options: json!({"max-download-limit": "200K"})
// .as_object()
// .unwrap()
// .clone(),
..Default::default()
};