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: reduce logging in ytdlp functions for cleaner output

Tonho1c251f7309ce
diff --git a/src-tauri/src/core/ytdlp.rs b/src-tauri/src/core/ytdlp.rs
index 4a2eefe6..005f06f3 100644
--- a/src-tauri/src/core/ytdlp.rs
+++ b/src-tauri/src/core/ytdlp.rs
@@ -49,7 +49,6 @@ pub async fn ensure_ytdlp() -> anyhow::Result<PathBuf> {
return Ok(path);
}
- tracing::info!("yt-dlp não encontrado, baixando automaticamente...");
download_ytdlp_binary().await
}
@@ -69,8 +68,6 @@ async fn download_ytdlp_binary() -> anyhow::Result<PathBuf> {
"https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp"
};
- tracing::info!("Baixando yt-dlp de {}", download_url);
-
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(120))
.build()?;
@@ -94,13 +91,10 @@ async fn download_ytdlp_binary() -> anyhow::Result<PathBuf> {
tokio::fs::set_permissions(&target, perms).await?;
}
- tracing::info!("yt-dlp instalado em {:?}", target);
Ok(target)
}
pub async fn get_video_info(ytdlp: &Path, url: &str) -> anyhow::Result<serde_json::Value> {
- tracing::info!("yt-dlp: obtendo info de {}", url);
-
let output = tokio::process::Command::new(ytdlp)
.args(["--dump-json", "--no-warnings", "--no-playlist", url])
.stdout(Stdio::piped())
@@ -124,8 +118,6 @@ pub async fn get_playlist_info(
ytdlp: &Path,
url: &str,
) -> anyhow::Result<(String, Vec<PlaylistEntry>)> {
- tracing::info!("yt-dlp: obtendo playlist de {}", url);
-
let output = tokio::process::Command::new(ytdlp)
.args([
"--flat-playlist",
@@ -190,12 +182,6 @@ pub async fn get_playlist_info(
}
}
- tracing::info!(
- "yt-dlp: playlist '{}' com {} vídeos",
- playlist_title,
- entries.len()
- );
-
Ok((playlist_title, entries))
}
@@ -226,13 +212,6 @@ pub async fn download_video(
.to_string_lossy()
.to_string();
- tracing::info!(
- "yt-dlp download: url={}, format={}, output_dir={:?}",
- url,
- format_selector,
- output_dir
- );
-
tokio::fs::create_dir_all(output_dir).await?;
let mut child = tokio::process::Command::new(ytdlp)
@@ -283,12 +262,6 @@ pub async fn download_video(
let file_path = find_downloaded_file(output_dir, url).await?;
let meta = tokio::fs::metadata(&file_path).await?;
- tracing::info!(
- "yt-dlp download concluído: {:?} ({} bytes)",
- file_path,
- meta.len()
- );
-
Ok(DownloadResult {
file_path,
file_size_bytes: meta.len(),