NodeJS teamspeak bot problem

bindik

VIP
May 10, 2016
40
24
55
Greetings, i have embedded nodejs to teamspeak plugin because i want to make scripting and everything much more easier, editing on fly etc.
What i want to do is https request towards youtube so i can download video -> ffmpeg -> mp3 play it.

My problem is that it crashes on any https request, i have compiled it wil libssl, libcrypto.

Bot crashes with no specific error, just
Code:
Breakpad crash /root/.ts3client/crashdumps/730c15e1-943c-4cc9-6987e148-71d110aa.dmp
Starting Error Reporter: /home/nodejs/ts/client/TeamSpeak3-Client-linux_amd64/error_report
./ts3client_runscript.sh: line 51: 29013 Segmentation fault      ./ts3client_linux_amd64 $@
xinit: connection to X server lost
Code:
request('https://youtube.com/', function(err, res, body) {
    console.log(body);
});
//baaam crash

HTTP request work fine, i would use http on youtube but it seems that youtube wont respond to non https request anymore, atleast body is empty
any ideas?


offtopic
If anyone is interested in library, or what i made and i am using check https://github.com/eskejpo/NearJS
It is modified nearjs library that is thread safe, sends, receives json objects instead of strings.
Example of what you can do
Code:
//const channel definitions ^
var channel = {
    createChannel: function(channel, password, parent){
        var returnObject = {};
        //receives bool if request was successfull
        returnObject.channelName = escbot.hostCall("setChannelVariableAsString", {serverConnectionHandlerID: 1, channelID: 0, flag: CHANNEL_NAME, value: channel});
        returnObject.channelTopic = escbot.hostCall("setChannelVariableAsString", {serverConnectionHandlerID: 1, channelID: 0, flag: CHANNEL_TOPIC, value: "Channel created by NodeJS BOT"});
        returnObject.channelDescription = escbot.hostCall("setChannelVariableAsString", {serverConnectionHandlerID: 1, channelID: 0, flag: CHANNEL_DESCRIPTION, value: "Channel created by NodeJS BOT"});
     
        if(password.length != 0)
            returnObject.channelPassword = escbot.hostCall("setChannelVariableAsString", {serverConnectionHandlerID: 1, channelID: 0, flag: CHANNEL_PASSWORD, value: password});
     
        returnObject.channelSemiPermanent = escbot.hostCall("setChannelVariableAsInt", {serverConnectionHandlerID: 1, channelID: 0, flag: CHANNEL_FLAG_SEMI_PERMANENT, value: 0});
        returnObject.channelPermanent = escbot.hostCall("setChannelVariableAsInt", {serverConnectionHandlerID: 1, channelID: 0, flag: CHANNEL_FLAG_PERMANENT, value: 1});
        returnObject.channelCreateStatus = escbot.hostCall("flushChannelCreation", {serverConnectionHandlerID: 1, channelParentID: parent});
        return returnObject;
       //returns status of each request so you can determine what went wrong
    },
    getChannelByName: function(channelPath){
        if(channelPath.length > 1)
            return escbot.hostCall("getChannelIDFromChannelNames", {serverConnectionHandlerID: 1, channelNameArray: channelPath});
     
        return false;
    }
}

Temporary solved by creating another nodejs server to forward requests :p
 
Last edited:
Top