diff options
| author | Nathan Perry <np@nathanperry.dev> | 2022-11-29 10:59:06 -0500 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2022-11-29 10:59:06 -0500 |
| commit | f7155b7372f9007a378cb07d5acdc1abcc8cc7f1 (patch) | |
| tree | 6981ff28abe928cb3b2cef1f31ed5cadbc7c5c68 /src/audio/ytdl.rs | |
| parent | f15a23587dd474c539e4ec3bc3a10d0a22b2ae55 (diff) | |
fs: parameterize remote references
Diffstat (limited to 'src/audio/ytdl.rs')
| -rw-r--r-- | src/audio/ytdl.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/audio/ytdl.rs b/src/audio/ytdl.rs index 46f0e27..002244c 100644 --- a/src/audio/ytdl.rs +++ b/src/audio/ytdl.rs @@ -13,8 +13,13 @@ use serenity::{ VoiceError, } }; +use lazy_static::lazy_static; -use crate::Result; +use crate::{Result, CONFIG}; + +lazy_static! { + static ref YTDL_COMMAND: String = CONFIG.ytdl.clone().unwrap_or("youtube-dl".to_owned()); +} pub fn ytdl_url(uri: &str) -> Result<String> { let args = [ @@ -26,7 +31,7 @@ pub fn ytdl_url(uri: &str) -> Result<String> { uri, ]; - let out = Command::new("youtube-dl") + let out = Command::new(&*YTDL_COMMAND) .args(&args) .stdin(Stdio::null()) .output()?; |
