• The TeamSpeak Client 3.1.10 on Linux is currently not supported. Use Client version 3.1.9 or follow our installation guide.
  • If you need help or want to discuss things, you now can also join us on our Discord Server!

Streaming to Icecast 2 server

Status
Not open for further replies.
#1
Hello, I would like to stream to an Icecast 2 server. I've found a script on the forum before, which is this:
Code:
registerPlugin({
    name: 'stream2icecast',
    version: '1.0',
    description: '',
    author: 'Michael Friese <[email protected]>',
    whose: {
        streamServer: {
            title: 'http://sv.something.com:8000/autodj',
            type: 'string'
        },
        streamPassword: {
            title: 'blahblahblah',
            type: 'string'
        }
    }
}, function(sinusbot, config) {
    if (config.streamServer && config.streamPassword) sinusbot.streamToServer(config.streamServer, 'source', config.streamPassword);
});
However, this doesn't work, it only gives me this in the instance log:
Code:
2017-12-18T13:11:37+00:00 Initialization complete
2017-12-18T13:11:37+00:00 Loading script streamtoicecast
 

flyth

is reticulating splines
Staff member
Developer
#2
That script looks pretty old needs to be updated to the new scripting engine, but mainly the whose: { should be changed to vars: { and then you'd need to set the values in the script settings. It _might_ still work.
 
#3
That version was the version translated with the web page, I've since changed it to:
Code:
registerPlugin({
    name: 'stream2icecast',
    version: '1.0',
    description: '',
    author: 'Michael Friese <[email protected]>',
    vars: {
        streamServer: {
            title: 'http://sv.meme.com:8000/autodj',
            type: 'string'
        },
        streamPassword: {
            title: 'meme',
            type: 'string'
        }
    }
}, function(sinusbot, config) {
    if (config.streamServer && config.streamPassword) sinusbot.streamToServer(config.streamServer, 'source', config.streamPassword);
});
However, now no scripts appear in the script section in the settings:


So I have no idea whats happening anymore
 

flyth

is reticulating splines
Staff member
Developer
#4
Check the startup messages of the bot, it will tell you what's wrong with that script.
 
#5
This is the start up status:
Code:
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 [GENERAL/FFMPEG ] INFO   FFmpeg/avcodec v3741798; license: LGPL version 2.1 or later; 81 codecs
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 [GENERAL/FFMPEG ] INFO   FFmpeg/avformat v3742052; license: LGPL version 2.1 or later; 143 formats
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 [GENERAL/!!!!!!!] NOTICE You may now configure and launch the bots from the webinterface. http://0.0.0.0:8087
Dec 20 14:47:21 itscheesecake.co.uk systemd[1]: sinusbot.service: Main process exited, code=exited, status=255/n/a
Dec 20 14:47:21 itscheesecake.co.uk systemd[1]: sinusbot.service: Unit entered failed state.
Dec 20 14:47:21 itscheesecake.co.uk systemd[1]: sinusbot.service: Failed with result 'exit-code'.
 
#7
Here's the full thing:
Code:
[email protected]:~# systemctl status sinusbot
* sinusbot.service - Sinusbot, the Teamspeak 3 and Discord music bot.
   Loaded: loaded (/etc/systemd/system/sinusbot.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-12-20 14:47:21 GMT; 17s ago
  Process: 26655 ExecStopPost=/bin/rm -f /tmp/.sinusbot.lock (code=exited, status=0/SUCCESS)
  Process: 26642 ExecStart=/opt/sinusbot/sinusbot (code=exited, status=255)
  Process: 26638 ExecStartPre=/bin/rm -f /tmp/.sinusbot.lock (code=exited, status=0/SUCCESS)
 Main PID: 26642 (code=exited, status=255)

Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 22cc03b5          INFO   Loading instance://8599596e-44bf-4c21-b64b-f22767bce673
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 22cc03b5 8599596e INFO   Initialization complete
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 22cc03b5 8599596e INFO   Auto-Starting 22cc03b5-c666-4712-bb4d-f53b6b58a30f/8599596e-44bf-4c21-b64b-f22767bce673 in 1000 ms...
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 22cc03b5 8599596e INFO   Last track was 8a835079-0089-474e-8222-f6a7f671ff97, will auto-play soon
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 [GENERAL/FFMPEG ] INFO   FFmpeg/avcodec v3741798; license: LGPL version 2.1 or later; 81 codecs
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 [GENERAL/FFMPEG ] INFO   FFmpeg/avformat v3742052; license: LGPL version 2.1 or later; 143 formats
Dec 20 14:47:21 itscheesecake.co.uk sinusbot[26642]: 2017/12/20 14:47:21 [GENERAL/!!!!!!!] NOTICE You may now configure and launch the bots from the webinterface. http://0.0.0.0:8087
Dec 20 14:47:21 itscheesecake.co.uk systemd[1]: sinusbot.service: Main process exited, code=exited, status=255/n/a
Dec 20 14:47:21 itscheesecake.co.uk systemd[1]: sinusbot.service: Unit entered failed state.
Dec 20 14:47:21 itscheesecake.co.uk systemd[1]: sinusbot.service: Failed with result 'exit-code'.
 

flyth

is reticulating splines
Staff member
Developer
#8
No, that's still not everything. Maybe your startscript/initsystem eats it. You could also define a logfile in the config.ini.
 
#9
In my config, the loglevel is 10. That was the log from the command "systemctl status sinusbot", should I be looking in a log file?
 
#10
I read your last message wrong, I set a log file, here is it:
Code:
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin advertising.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin alonemode.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin bookmark.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin followme.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin norecording.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin rememberChannel.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin streamtoicecast.js
2017/12/20 15:55:13 [GENERAL/SCRIPTS] INFO   Loading ScriptPlugin welcome.js
2017/12/20 15:55:13 22cc03b5          INFO   Loading instances
2017/12/20 15:55:13 22cc03b5          INFO   Loading instance://8599596e-44bf-4c21-b64b-f22767bce673
2017/12/20 15:55:13 22cc03b5 8599596e INFO   Initialization complete
2017/12/20 15:55:13 22cc03b5 8599596e INFO   Auto-Starting 22cc03b5-c666-4712-bb4d-f53b6b58a30f/8599596e-44bf-4c21-b64b-f22767bce673 in 500 ms...
2017/12/20 15:55:13 22cc03b5 8599596e INFO   Last track was 8a835079-0089-474e-8222-f6a7f671ff97, will auto-play soon
2017/12/20 15:55:13 22cc03b5          INFO   Loading instance://b2d90027-6aa7-4ddc-bbb8-7ceecb9e1da9
2017/12/20 15:55:13 22cc03b5 b2d90027 INFO   Loading script streamtoicecast
2017/12/20 15:55:13 22cc03b5 b2d90027 INFO   Initialization complete
2017/12/20 15:55:13 [GENERAL/FFMPEG ] INFO   FFmpeg/avcodec v3741798; license: LGPL version 2.1 or later; 81 codecs
2017/12/20 15:55:13 [GENERAL/FFMPEG ] INFO   FFmpeg/avformat v3742052; license: LGPL version 2.1 or later; 143 formats
2017/12/20 15:55:13 [GENERAL/!!!!!!!] NOTICE You may now configure and launch the bots from the webinterface. http://0.0.0.0:8087
 

EchtkPvL

Donor
is awesome!
#11
Try this (not tested)
JavaScript:
registerPlugin({
  name: 'stream2icecast',
  version: '1.0',
  description: '',
  author: 'Michael Friese <[email protected]>',
  vars: [{
      name: 'streamServer',
      title: 'StreamServer URL',
      type: 'string',
      placeholder: 'http://sv.meme.com:8000/autodj'
    }, {
      name: 'streamUser',
      title: 'User',
      type: 'string'
    }, {
      name: 'streamPassword',
      title: 'Password',
      type: 'string'
    }]
}, function (sinusbot, config) {
  var engine = require('engine'), audio = require('audio');

  if(!config.streamUser){
    config.streamUser = 'source';
  }

  if (config.streamServer && config.streamPassword){
    audio.streamToServer(config.streamServer, config.streamUser, config.streamPassword);
  }else{
    engine.log("URL or Password missing!");
  }
});
Code:
2018/02/09 16:52:20 INFO   Loading script stream2icecast
2018/02/09 16:52:20 INFO   Connecting to icecast: sv.meme.com:8000
2018/02/09 16:52:20 INFO   End Streaming
2018/02/09 16:52:20 INFO   Streaming
 
Status
Not open for further replies.

Similar threads