Fix bugs probably

master
Marrub 2017-09-11 08:49:10 -04:00
parent 48c1b572ee
commit a9a9961c37
1 changed files with 8 additions and 3 deletions

View File

@ -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