From 17b6648725cea478a5ba28e0b3dfbd5973adb264 Mon Sep 17 00:00:00 2001 From: Cycle Five Date: Sun, 30 Jun 2024 15:59:50 +0000 Subject: [PATCH] asdf --- crack-core/src/commands/register.rs | 1 - crack-core/src/guild/settings.rs | 4 ++++ crack-core/src/sources/ytdl.rs | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crack-core/src/commands/register.rs b/crack-core/src/commands/register.rs index 8516b00c..728cdc53 100644 --- a/crack-core/src/commands/register.rs +++ b/crack-core/src/commands/register.rs @@ -39,7 +39,6 @@ pub fn create_application_commands_cracked( let mut commands_builder = Vec::with_capacity(commands.len()); for command in commands { - tracing::warn!("Creating command: {:?}", command.name); if let Some(slash_command) = command.create_as_slash_command() { commands_builder.push(slash_command); } diff --git a/crack-core/src/guild/settings.rs b/crack-core/src/guild/settings.rs index 5db6c83c..ae91f0a8 100644 --- a/crack-core/src/guild/settings.rs +++ b/crack-core/src/guild/settings.rs @@ -21,6 +21,10 @@ use typemap_rev::TypeMapKey; pub(crate) const DEFAULT_LOG_PREFIX: &str = "data/logs"; pub(crate) const DEFAULT_ALLOW_ALL_DOMAINS: bool = true; pub(crate) const DEFAULT_SETTINGS_PATH: &str = "data/settings"; +#[allow(dead_code)] +pub(crate) const PIPED_WATCH_URL: &str = "https://piped.video/watch?v="; +pub(crate) const YOUTUBE_WATCH_URL: &str = "https://www.youtube.com/watch?v="; +pub(crate) const VIDEO_WATCH_URL: &str = YOUTUBE_WATCH_URL; pub(crate) const DEFAULT_ALLOWED_DOMAINS: [&str; 1] = ["youtube.com"]; pub(crate) const DEFAULT_VOLUME_LEVEL: f32 = 1.0; pub(crate) const DEFAULT_VIDEO_STATUS_POLL_INTERVAL: u64 = 120; diff --git a/crack-core/src/sources/ytdl.rs b/crack-core/src/sources/ytdl.rs index 5a4acc75..21e56eeb 100644 --- a/crack-core/src/sources/ytdl.rs +++ b/crack-core/src/sources/ytdl.rs @@ -1,4 +1,5 @@ use crate::errors::CrackedError; +use crate::guild::settings::VIDEO_WATCH_URL; use std::fmt::Display; use tokio::process::Command; use tokio::runtime::Handle; @@ -82,7 +83,7 @@ impl MyYoutubeDl { None } else { let id_string = String::from_utf8_lossy(x); - let url = format!("{}{}", "https://www.youtube.com/watch?v=", &id_string); + let url = format!("{}{}", VIDEO_WATCH_URL, &id_string); drop(id_string); Some(url) }