diff options
Diffstat (limited to 'src/voice/mod.rs')
| -rw-r--r-- | src/voice/mod.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/voice/mod.rs b/src/voice/mod.rs index fcb0b07..5a89f93 100644 --- a/src/voice/mod.rs +++ b/src/voice/mod.rs | |||
| @@ -16,6 +16,7 @@ use symphonia::core::meta::MetadataOptions; | |||
| 16 | use tokio::sync::Mutex; | 16 | use tokio::sync::Mutex; |
| 17 | use tracing::{info, warn}; | 17 | use tracing::{info, warn}; |
| 18 | 18 | ||
| 19 | use crate::copyparty::redact_url; | ||
| 19 | use crate::error::{Error, Result}; | 20 | use crate::error::{Error, Result}; |
| 20 | use crate::lang; | 21 | use crate::lang; |
| 21 | use crate::recording::{Recorder, RecorderEventHandler}; | 22 | use crate::recording::{Recorder, RecorderEventHandler}; |
| @@ -241,7 +242,11 @@ pub async fn ytdlp_download(url: &str) -> Result<Vec<u8>> { | |||
| 241 | let stderr = String::from_utf8_lossy(&output.stderr); | 242 | let stderr = String::from_utf8_lossy(&output.stderr); |
| 242 | // Keep the full yt-dlp trace in the logs for debugging — the user | 243 | // Keep the full yt-dlp trace in the logs for debugging — the user |
| 243 | // only ever sees the short, translated `fmt_ytdlp_stderr` message. | 244 | // only ever sees the short, translated `fmt_ytdlp_stderr` message. |
| 244 | warn!(url = %url, "yt-dlp failed:\n{}", stderr.trim_end()); | 245 | warn!( |
| 246 | url = %redact_url(url), | ||
| 247 | "yt-dlp failed:\n{}", | ||
| 248 | stderr.trim_end() | ||
| 249 | ); | ||
| 245 | return Err(Error::Custom(lang::fmt_ytdlp_stderr(&stderr))); | 250 | return Err(Error::Custom(lang::fmt_ytdlp_stderr(&stderr))); |
| 246 | } | 251 | } |
| 247 | 252 | ||
| @@ -256,11 +261,11 @@ pub async fn download_url(client: &reqwest::Client, url: &str) -> Result<Vec<u8> | |||
| 256 | .get(url) | 261 | .get(url) |
| 257 | .send() | 262 | .send() |
| 258 | .await | 263 | .await |
| 259 | .map_err(|e| Error::Custom(format!("HTTP GET failed for {url}: {e}")))?; | 264 | .map_err(|e| Error::Custom(format!("HTTP GET failed for {}: {e}", redact_url(url))))?; |
| 260 | let bytes = resp | 265 | let bytes = resp |
| 261 | .bytes() | 266 | .bytes() |
| 262 | .await | 267 | .await |
| 263 | .map_err(|e| Error::Custom(format!("Failed to read body for {url}: {e}")))?; | 268 | .map_err(|e| Error::Custom(format!("Failed to read body for {}: {e}", redact_url(url))))?; |
| 264 | Ok(bytes.to_vec()) | 269 | Ok(bytes.to_vec()) |
| 265 | } | 270 | } |
| 266 | 271 | ||
| @@ -398,7 +403,11 @@ pub async fn ffmpeg_stream_input(url: &str) -> Result<songbird::input::Input> { | |||
| 398 | let _ = reader.read_to_end(&mut buf).await; | 403 | let _ = reader.read_to_end(&mut buf).await; |
| 399 | let text = String::from_utf8_lossy(&buf); | 404 | let text = String::from_utf8_lossy(&buf); |
| 400 | if !text.is_empty() { | 405 | if !text.is_empty() { |
| 401 | warn!(url = %url_owned, "ffmpeg stderr: {}", text.trim_end()); | 406 | warn!( |
| 407 | url = %redact_url(&url_owned), | ||
| 408 | "ffmpeg stderr: {}", | ||
| 409 | text.trim_end() | ||
| 410 | ); | ||
| 402 | } | 411 | } |
| 403 | }); | 412 | }); |
| 404 | } | 413 | } |
