-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream is closed #1
Comments
Funny enough, the reason why I created this was for my bot as well... From a brief overview, it looks as if the NPM package The thing is with SoundCloud is that the labeling of tracks is very inconsistent so this may be an issue if you are trying to properly format a song title. Now regarding the While unrelated to the package, the proper way you would play this back using discord.js, is by doing this let connection = await msg.member.voiceChannel.join() // Joins the VC
let stream = new PassThrough() // Creates a PassThrough (which discord.js accepts for ReadableStreams)
let song = await SoundCloudDownloader.getStream(12345789) // Gets the song based on ID
stream.end(Buffer.from(song.body, 'binary')) // Writes to the readable stream with the mp3 file
server.dispatcher = connection.playStream(stream) // Plays the stream I hope this helps |
Oh. The README of this package tells that I tried your code to play music with
Now, for the code about
Update: I tried the link of your package |
@North-West-Wind Okay thank you for the information... I will attempt to investigate the issue further in the morning. I have a feeling that either the key is invalid, you're being rate-limited/blocked on SoundCloud or SoundCloud changed something on their end. |
Alright, I think my key may be blocked. It gives |
I grabbed another Client ID and tried the link Now I've figured that out, I'm closing this. Note that the error of playing the stream in |
After a few tests with the new client id, I still ran into problems but the client id do work in my browser. |
Okay, I now know what it is. I encountered this issue a while back when I was developing my own bot. The new ID's generated by SoundCloud are temporary ID's that have limited access and are thrown out after some time. This is because of the fact that SoundCloud no longer officially supports the old V1 API. Older IDs typically are ones registered with the old SoundCloud API and are permanent. My only advice is to try and look around for an old ID on the internet. I am keeping this issue open as it is still a relevant and active problem. |
Yes I got myself an old ID and it still doesn't work until I found out I was so dumb that I had a line me my |
I used my browser's client ID (I dont know if this is the reason it doesn't work) to try to get a readable stream from soundcloud and parse it into
music-metadata
. However,music-metadata
gives me an error aboutError: Stream closed
.In fact, I'm trying to make my
discord.js
music bot play soundcloud tracks, but it didn't work. It just instantly end without any error.Any idea about what's wrong?
The text was updated successfully, but these errors were encountered: