From e9e3458225cfc0fdc20a7d2960ef15d4de349802 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Sun, 17 Feb 2019 01:59:22 -0500 Subject: support audio memes --- src/audio/ytdl.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/audio/ytdl.rs') diff --git a/src/audio/ytdl.rs b/src/audio/ytdl.rs index d16d166..8384db4 100644 --- a/src/audio/ytdl.rs +++ b/src/audio/ytdl.rs @@ -42,7 +42,7 @@ impl Drop for ChildContainer { } } -pub fn ytdl(uri: &str, start: Option, end: Option) -> Result> { +pub fn ytdl_reader(uri: &str, start: Option, end: Option) -> Result> { let args = [ "-f", "webm[abr>0]/bestaudio/best", @@ -113,5 +113,10 @@ pub fn ytdl(uri: &str, start: Option, end: Option) -> Result .stdout(Stdio::piped()) .spawn()?; - Ok(pcm(true, ChildContainer(command))) + Ok(Box::new(ChildContainer(command))) +} + +pub fn ytdl(uri: &str, start: Option, end: Option) -> Result> { + let command = ytdl_reader(uri, start, end)?; + Ok(pcm(true, command)) } -- cgit v1.3.1