diff --git a/plugins/radio.rb b/plugins/radio.rb index 09939c5..644e8f4 100644 --- a/plugins/radio.rb +++ b/plugins/radio.rb @@ -26,7 +26,8 @@ class Radio end def on_help(m) - m.reply 'curl "http://soyuz.labr.xyz:8080/" | play -q - 2>/dev/null' + m.reply 'curl ""http://utvghefxggihh5ts.onion" | play -q - 2>/dev/null' + m.reply 'http://soyuz.labr.xyz:8000 - qua sta l\'interfaccia webbosa - poi ritorna' m.reply 'comandi: ' m.reply ' info - ti dice la canzone che stai sentendo' m.reply ' pialla - cancella la canzone che stai sentendo' @@ -43,9 +44,15 @@ class Radio end def on_info(m) - title = `mpc | head -n 1 | cut -d '#' -f 2 | base64 -d` - title.gsub("\n","") - m.reply CGI.unescapeHTML(title) + info = `mpc`.split("\n") + return if info.empty? || info.count <3 + title = Base64.decode64(info[0].split('#').last).chomp + songs,time = "0" + if info[1] =~ /.* #[0-9]+\/([0-9]+)\s(.*)/ + songs = $1 + time = $2.strip + end + m.reply CGI.unescapeHTML(title)+" ["+time+"] "+songs+" songs in playlist" end def on_next(m)