fix: add missing tokio features and correct doc-test examples

This commit is contained in:
nvrl committed 2026-03-22 12:08:47 +01:00
1 parent 559a310d36
commit 5268d86b17
2 files changed
+2 -6

No files matched your search

+1 -1
View File
@@ -12,6 +12,6 @@ readme = "README.md"
[dependencies]
regex = "1.11.1"
thiserror = "2.0.11"
tokio = { version = "1.43.0", features = ["process", "rt", "macros", "fs"] }
tokio = { version = "1.43.0", features = ["process", "rt", "rt-multi-thread", "macros", "fs"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.138"
+1 -5
View File
@@ -12,7 +12,7 @@
//! let ytd = YtDlp::new("https://www.youtube.com/watch?v=uTO0KnDsVH0")
//! .output_dir(path)
//! .arg("--quiet")
//! .arg("--output", "%(title).90s.%(ext)s");
//! .arg_with("--output", "%(title).90s.%(ext)s");
//!
//! let result = ytd.download().await?;
//! println!("Download complete: {}", result.output());
@@ -195,7 +195,6 @@ impl YtDlp {
#[cfg(test)]
mod tests {
use super::*;
use std::env;
#[tokio::test]
async fn test_version() -> Result<()> {
@@ -209,9 +208,6 @@ mod tests {
#[tokio::test]
async fn test_get_info() -> Result<()> {
// Use a very short/small video for testing if possible, or just check if it fails
// For local tests, we'll just check if it can spawn.
let ytd = YtDlp::new("https://www.youtube.com/watch?v=uTO0KnDsVH0");
// We won't actually download in CI if it's too slow, but let's try a version check as a proxy
let version = YtDlp::new("").arg("--version").download().await?;
println!("yt-dlp version: {}", version.output());