qbittorrent_web_api/qbittorrent-web-api-gen/tests/access_search.rs
2022-07-14 10:30:31 +00:00

22 lines
649 B
Rust

use anyhow::Result;
use qbittorrent_web_api_gen::QBittorrentApiGen;
const USERNAME: &str = "admin";
const PASSWORD: &str = "adminadmin";
const BASE_URL: &str = "http://localhost:8080";
#[derive(QBittorrentApiGen)]
struct Api {}
#[tokio::main]
async fn main() -> Result<()> {
let api = Api::login(BASE_URL, USERNAME, PASSWORD).await?;
let _ = api.search().delete(1).send().await?;
let _ = api.search().plugins().await?;
let _ = api.search().plugins().await?;
let _ = api.search().install_plugin("https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/legittorrents.py").send().await?;
Ok(())
}