• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN [Question] Media.YoutubeDL

pa3ck

Active Member
Hi, I have the following code which basically stores Youtube-DL URL in a variable and when I use !resume it should play it back. The problem is, that I'm getting youtube download failed error..

JavaScript:
var media = require('media');
var lastYT = "";
event.on('chat', function(ev){
        if (ev.text.match(new RegExp("^!yt.+$"))) {
            var cmd = ev.text.split(" ");
            if(cmd[1] != undefined ){
                lastYT = cmd[1].trim();
            }
        }else if(ev.text == '!resume'){
            ev.client.chat("Előző zene lejátszása: " + lastYT);
            media.yt(lastYT);
        }
    });

When I replace media.yt(lastYT) with a hardcoded URL it works.. is there anything I'm missing for media.yt function?
 
Top