• 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.

DE Nutzung des Sinusbot Web-API Audio Stream / usage of sinusbot web-api audio stream

vincolus

Donor
is awesome!
Contributor
Insider
Ich weiß, dass das früher mal geklappt hat, aber nun bekomme ich immer einen Fehler 401, wenn ich versuche, auf den OGG-Opus-Enkodierten Audio-Stream mittels Web-API zuzugreifen.

Ich versuche es folgendermaßen:
1.) Ich hole mir einen Token für den Webstream wie hier beschrieben: https://www.sinusbot.com/api/#api-Streaming-getStreamToken
2.) Mit dem Token und der Instanz-ID generiere ich die Stream-URL, also ersetze die Paramter <instanceId> und <token> durch die entsprechenden Werte, und übergebe diese an den HTML5 audio- bzw. video-player, der mir dann einen 401 zurückgibt.
Direkt über den Browser kann ich die URL bzw. den Stream auch nicht aufrufen, was früher m.W. noch ging.

Hat sich da eventuell etwas geändert oder gibt es das vielleicht gar nicht mehr?
Ich habe in der config folgendes gesetzt:
EnableWebStream = true

Danke für jede Antwort!
-----------------------------------------------------------------------------------------------------------------------------------------------
I know this has worked before, but currently I am unable to obtain an audio stream. I always get a 401 - which stands for 'unauthorized'.

What I do is this:
1.) I am fetching a token for the webstream as described here: https://www.sinusbot.com/api/#api-Streaming-getStreamToken
2.) With the token and the instanceId I am concatenating the URL and pass it to the HTML audio or video tag, since it's a normal GET request that should return the stream.
But that does not work. At least not for me. I am always getting a 401.

Am I missing something or has something changed?
Of course I set EnableWebStream = true in config.ini

Thanks for any response!
 
Last edited:

vincolus

Donor
is awesome!
Contributor
Insider
Okay this is probably my last try reaching out to anyone who can help...
I am having a huge project based on sinusbot and it seems the API is badly documented or does not work as documented.
I am having this problem for too long now and noone seems to be able to ask my question while the internet and sinusbot itself are constantly evolving. How am I supposed to support this community if noone supports me doing it?

If really noone can help, then I'd see myself turning the back on sinusbot, writing my own music-bot.
 

flyth

is reticulating splines
Staff member
Developer
Contributor
The API you mention has probably been used by very few people, that's why reaaally few people can help you. And sadly it happens, that I miss one of these rare threads with valid bug reports. For that I'm really sorry. Feel free to reach out to the mods or me directly in the future - that might get you better / faster answers.

The API has been streamlined a bit in 2017 and if I interpret my code correctly, the path has been changed to:
/b/:botID/i/:instanceID/stream/:token

That change hasn't made it to the API documentation, sorry. As I'm reeaaally short on time, I'll add myself a note to fix that the next time I touch the docs.

I hope that solves your issue.

If really noone can help, then I'd see myself turning the back on sinusbot, writing my own music-bot.
There's really no need to threaten here, I think. But of course feel free to do so, if this project doesn't fit your needs anymore.
 

vincolus

Donor
is awesome!
Contributor
Insider
Hi Flyth and thanks for your answer.

Sometimes it seems you are the only one who can help, which is kinda sad considering there are so many people who developed scripts and webinterfaces for sinusbot...
I would have urged you via PM, but sadly on your profile it says "Please don't ask for support via PM. Seriously". Which is kinda threatening, too tbh ;)

I did invest much of my time into my sinusbot webinterface over the years and would like to stay with sinusbot as long as possible, but that requires a little attention, too. I cannot just develop thousands of hours into something I want to release to the community and then being stuck for months over an api method, because it's outdated and noone knows...

I will try out what you mentioned and I really appreciate you took the time to look into this thread, thanks!
Hope you dont forget to change the docs, but thanks so far anyways ;)

There's really no need to threaten here

Don't take it as a threat. I's just what I logically would have to do, because throwing my work away and not continuing work are no options to me at that point :)

Keep it up!
 

flyth

is reticulating splines
Staff member
Developer
Contributor
"Please don't ask for support via PM. Seriously"
Hehe, sadly only those people with real issues seem to care about that sentence as well... It's just there to save what is left of my inbox. I have always kept an open ear for those that are having problems building more sophisticated stuff with the bot, so next time just ping me in the chat (I usually see that) or send me a PM if telegram is an option to you as well.
 

TOP-TS

#stayinghome
Hehe, sadly only those people with real issues seem to care about that sentence as well... It's just there to save what is left of my inbox. I have always kept an open ear for those that are having problems building more sophisticated stuff with the bot, so next time just ping me in the chat (I usually see that) or send me a PM if telegram is an option to you as well.
Still waiting in PM from end of January... 😦
 

vincolus

Donor
is awesome!
Contributor
Insider
Für's Protokoll: Folgende URL hat sich als die richtige herausgestellt:
/api/v1/b/bot/i/<instanceID>/stream/<streamToken>
 
Top