ebencollins / sinusbot-stream Goto Github PK
View Code? Open in Web Editor NEWA web-based player to stream audio from SinusBot music bots.
License: GNU General Public License v3.0
A web-based player to stream audio from SinusBot music bots.
License: GNU General Public License v3.0
In index.php we need to change "https://bootswatch.com/darkly/bootstrap.min.css
" line 60 by
"https://bootswatch.com/3/darkly/bootstrap.min.css
"
I think It should be a good idea to add a music visualizer like this https://github.com/mydnic/WebRadioVisualizer
Best regards ;)
(Sinusbot 0.10.6-ea49bdc) Because for me not, got this error on console log via chrome :
GET http://ipofmyvps:8101/api/v1/bot/i/20372271-2d4d-4fb2-8e88-a680c0cea32e/stream/uQHwWHsiaSI6ImFjZjVjZWM3LWFmMjAtNDJkNi04OTMyLTA3ZWZhNDliNDdmMSIsImIiOiJkNGY1ZmExNS05MTk4LTRkNjctYTZmOC1lYzhmMDA1OTA0MTMiLCJ1AVbwW2RtaW4iLCJ0IjoxNTEwMTk2NjcyLCJzIjoiYjA5OTg2NWFlN2Q3ZjY0ZjU1ZTM1MmNjMDM5MDgyZDllZTkyNzgzNTYyMTU2OGUzYTU0NDQ5Yjc5YWMzMmVkYSJ9 401 (Unauthorized)
I keep getting error 401 despite editing the config.php
$user = "I created this user"; //username to login to the web panel
$passwd = "I provided the correct password"; //corresponding password
$title = "HyperVize-Radio"; //title to display
$teamspeakJoinLink="https://hypervize.nl"; //generate link in teamspeak by doing the following: Click tools on the menu bar, select invite buddy, select in my current server (or channel if you want), invitation ts3server link, paste the link here.
$instanceIDS = array("407c1ba1-8aa1-4467-aa76-removed");
$instanceNames = array("Now Playing...");
$defaultInstance = 0;
When I put all of your folder and when it's configure I got this : http://sinusbot.zalati.fr/
EDIT: Problem fixed
Like in the YT-search 2.1 (by Patrick15a) from Sinusbot Forum
It gave the possibility to get the direct link to the youtube video streamed by youtube-dl
I don't know if you can make an adaptation of this script for the SinusBot-Stream :)
Take a Look to the code :
registerPlugin({
name: 'YT-Search',
version: '2.1',
description: 'Search the current track on YouTube!',
author: 'Patrick15a [email protected]',
vars: [
{
name: 'ytCommand',
title: 'YouTube Search-Command',
type: 'string',
placeholder: 'Default: !ytsearch'
},
{
name: 'scCommand',
title: 'SoundCloud Search-Command',
type: 'string',
placeholder: 'Default: !scsearch'
},
{
name: 'prefix',
title: 'Prefix',
type: 'string',
placeholder: 'Default: [b][COLOR=#aa0000][[/COLOR][COLOR=#005500]YT-Search[/COLOR][COLOR=#aa0000]][/COLOR][/b]'
}
]
}, function(sinusbot, config) {
` var backend = require('backend');
var event = require('event');
var audio = require('audio');
var media = require('media');
//Set Default's
if (typeof config.prefix == 'undefined' || config.prefix === '') {
var prefix = '[b][COLOR=#aa0000][[/COLOR][COLOR=#005500]YTsearch[/COLOR][COLOR=#aa0000]][/COLOR][/b]';
}
if (typeof config.ytCommand == 'undefined' || config.ytCommand === '') {
var ytcmd = '!ytsearch';
}
if (typeof config.scCommand == 'undefined' || config.scCommand === '') {
var sccmd = '!scsearch';
}
//Get current TrackInfos
function getTrack() {
var track = media.getCurrentTrack();
if (typeof track.tempTitle() != 'undefined' && track.tempTitle() != '') {
var title = track.tempTitle();
} else if (track.title() != 'undefined' && track.title() != '') {
var title = track.title();
} else {
var title = '';
}
if (typeof track.tempArtist() != 'undefined' && track.tempArtist() != '') {
var artist = track.tempArtist();
} else if (track.artist() != 'undefined' && track.artist() != '') {
var artist = track.artist();
} else if (typeof track.album() != 'undefined' && track.album() != ''){
var artist = track.album();
} else {
var artist = '';
}
title = title.replace(/ /g, '+');
title = title.replace(/&/g, '%26');
title = title.replace(/'?'/g, '%3F');
artist = artist.replace(/ /g, '+');
artist = artist.replace(/&/g, '%26');
artist = artist.replace(/'?'/g, '%3F');
var search = artist + '+-+' + title;
return search;
}
//Create Search-link
function getSearchLink(provider) {
var search = getTrack();
if (provider == 'youtube') {
var track = media.getCurrentTrack();
if (track.type() == 'ytdl' && typeof track.url() != 'undefined') {
var ytwatch = 'https://www.youtube.com/watch?v='
var ytlink = ytwatch + track.url().split('url=')[1];
var finishlink = '[URL=' + ytlink + ']Youtube[/URL]';
} else {
var ytsearchquery = 'https://www.youtube.com/results?search_query=';
var ytlink = ytsearchquery + search;
var finishlink = '[URL=' + ytlink + ']Youtube[/URL]';
}
} else if (provider == 'soundcloud') {
var scsearchquery = 'https://soundcloud.com/search?q=';
var sclink = scsearchquery + search;
var finishlink = '[URL=' + sclink + ']SoundCloud[/URL]';
}
return finishlink;
}
//Send Message with Search-Link to User
event.on('chat', function(ev) {
if (audio.isPlaying()) {
switch (ev.text) {
case ytcmd:
link = getSearchLink('youtube');
ev.client.chat(prefix + ' Search the current track on ' + link + '.');
break;
case sccmd:
link = getSearchLink('soundcloud');
ev.client.chat(prefix + ' Search the current track on ' + link + '.');
break;
}
} else {
switch (ev.text) {
case ytcmd:
ev.client.chat(prefix + ' Sorry but the Bot is currently not playing music.');
break;
case sccmd:
ev.client.chat(prefix + ' Sorry but the Bot is currently not playing music.');
break;
}
}
});
});`
The video player appears with the correct poster image, but continues to have a loading icon forever. Song name also loads properly.
SinusBot (0.10.7-a91e4b6)
Like the title said, it is possible to add a feature for support temp artist and temp title for the SinusBot-Stream (Google research) Like music streaming directly by Youtube Interface : http://radio.zalati.fr/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.