diff --git a/source/modules/mod_audio.rb b/source/modules/mod_audio.rb index 377e36b..131ac74 100644 --- a/source/modules/mod_audio.rb +++ b/source/modules/mod_audio.rb @@ -14,8 +14,7 @@ class QueueItem if uri.scheme == "file" @fname = uri.path @is_file = true - elsif uri.host and uri.host.end_with? "youtube.com" or - uri.host.end_with? "youtu.be" + elsif uri.host and check_youtube_dl uri.host @fname = get_yt_vid_from uri @is_file = true else @@ -45,6 +44,12 @@ class QueueItem end private + def check_youtube_dl host + host.end_with? "youtube.com" or + host.end_with? "youtu.be" or + host.end_with? "soundcloud.com" + end + def get_yt_vid_from uri yt_tmp = get_tmp_name "vrobot4_yt_temp_", ".m4a" mv_tmp = get_tmp_name "vrobot4_mv_temp_", ".mp3" @@ -92,7 +97,7 @@ class Mod_Audio < Vrobot4::Module::Module end def c_quit m, argv - m.serv.voice_quit + m.serv.voice_quit m end def c_queue m, argv