Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/stream_pulse/src/lib/process_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ fn handle_stream_audio(

// Skip download if .mp3 already exists
if !audio_mp3_path.exists() {
if let Err(e) = ytdlp.download_audio(&youtube_stream, &audio_base_path) {
tracing::error!(error = ?e, "Failed to download video");
bail!("Failed to download video: {:?}", e);
if let Err(e) = ytdlp
.download_audio(&youtube_stream, &audio_base_path)
.inspect_err(|e| tracing::error!(error = ?e, "Failed to download audio"))
{
bail!("Failed to download audio: {:?}", e);
};
} else {
tracing::debug!("Audio already exists at {:?}", audio_mp3_path);
Expand Down
2 changes: 1 addition & 1 deletion crates/ytdlp_bindings/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
("linux", "x86_64" | "x86") => "yt-dlp_linux",
("linux", "aarch64") => "yt-dlp_linux_aarch64",
("linux", "arm") => "yt-dlp_linux_armv7I",
_ => return Err(format!("Unsupported platform: {} {}", target_os, target_arch).into()),
_ => return Err(format!("Unsupported platform: {target_os} {target_arch}").into()),
};

// Create an output directory for the binary
Expand Down
4 changes: 2 additions & 2 deletions crates/ytdlp_bindings/src/processors/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{error::YtDlpError, YtDlp};
use std::path::Path;

/// A trait for processing video files.
/// Requires `ffmpeg` v7* available in the evironment
/// Requires `ffmpeg` v7* available in the environment
pub trait VideoProcessor {
/// Converts a video to a different format.
///
Expand Down Expand Up @@ -75,7 +75,7 @@ impl VideoProcessor for YtDlp {
let output_str = output_template.as_ref().to_str().ok_or_else(|| {
YtDlpError::InvalidPath(output_template.as_ref().display().to_string())
})?;
let fps = format!("fps={}", fps);
let fps = format!("fps={fps}");
let extra_args = extra_args.map(|args| args.join(" ")).unwrap_or_default();

// ffmpeg -i input_video.mp4 -vf fps=1/10 output_%04d.png
Expand Down
Loading