diff --git a/Cargo.toml b/Cargo.toml index 466b6b1..8931bb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,19 +1,17 @@ [package] name = "ytd-rs" -version = "0.1.7" -authors = ["Nils Pukropp "] -edition = "2018" -license-file ="LICENSE" -description = "A simple wrapper for youtube-dl. Youtube-dl has to be installed on the system" +version = "0.2.0" +authors = ["Nils Pukropp "] +edition = "2024" +license-file = "LICENSE" +description = "An async, full-featured wrapper for yt-dlp." homepage = "https://github.com/Nirusu99/ytd-rs" repository = "https://github.com/Nirusu99/ytd-rs" readme = "README.md" -[features] -yt-dlp = [] -youtube-dlc = [] - - [dependencies] -regex = "1.5.5" -thiserror = "1.0.30" +regex = "1.11.1" +thiserror = "2.0.11" +tokio = { version = "1.43.0", features = ["process", "rt", "macros", "fs"] } +serde = { version = "1.0.217", features = ["derive"] } +serde_json = "1.0.138" diff --git a/src/error.rs b/src/error.rs index da85aeb..b94527d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,11 +1,13 @@ use thiserror::Error; #[derive(Error, Debug)] -pub enum YoutubeDLError { - #[error("failed to execute youtube-dl")] +pub enum YtDlpError { + #[error("failed to execute yt-dlp: {0}")] IOError(#[from] std::io::Error), - #[error("failed to convert path")] + #[error("failed to convert output to string: {0}")] UTF8Error(#[from] std::string::FromUtf8Error), - #[error("youtube-dl exited with: {0}")] + #[error("failed to parse JSON: {0}")] + JsonError(#[from] serde_json::Error), + #[error("yt-dlp exited with error: {0}")] Failure(String), }