Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat: make parse_video_info public and enhance ytdlp path handling

Tonho0f0791b16e64
diff --git a/src-tauri/src/platforms/generic_ytdlp/mod.rs b/src-tauri/src/platforms/generic_ytdlp/mod.rs
index ae837f88..432fdb5e 100644
--- a/src-tauri/src/platforms/generic_ytdlp/mod.rs
+++ b/src-tauri/src/platforms/generic_ytdlp/mod.rs
@@ -54,7 +54,7 @@ impl GenericYtdlpDownloader {
}
}
- fn parse_video_info(json: &serde_json::Value) -> anyhow::Result<MediaInfo> {
+ pub fn parse_video_info(json: &serde_json::Value) -> anyhow::Result<MediaInfo> {
let title = json
.get("title")
.and_then(|v| v.as_str())
@@ -172,7 +172,11 @@ impl PlatformDownloader for GenericYtdlpDownloader {
) -> anyhow::Result<DownloadResult> {
let _ = progress.send(0.0).await;
- let ytdlp_path = ytdlp::ensure_ytdlp().await?;
+ let ytdlp_path = if let Some(ref p) = opts.ytdlp_path {
+ p.clone()
+ } else {
+ ytdlp::ensure_ytdlp().await?
+ };
let first = info
.available_qualities