aboutsummaryrefslogtreecommitdiffstats
path: root/src/voice
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 01:06:38 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 01:06:38 +0100
commit64afa0fd8c863deb6a1568428dfaf2ce67ef9085 (patch)
tree14ff21f7bcb30d8a5234a2d535e0977d0d5f5a04 /src/voice
parentsay: do not abort if the ephemeral ack is already gone (diff)
downloadsenator-sperma-64afa0fd8c863deb6a1568428dfaf2ce67ef9085.tar.gz
senator-sperma-64afa0fd8c863deb6a1568428dfaf2ce67ef9085.zip
copyparty: never send the password to foreign hosts
Diffstat (limited to '')
-rw-r--r--src/voice/mod.rs17
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;
16use tokio::sync::Mutex; 16use tokio::sync::Mutex;
17use tracing::{info, warn}; 17use tracing::{info, warn};
18 18
19use crate::copyparty::redact_url;
19use crate::error::{Error, Result}; 20use crate::error::{Error, Result};
20use crate::lang; 21use crate::lang;
21use crate::recording::{Recorder, RecorderEventHandler}; 22use 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 }