Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Streaming to Discord voice channel? #339

Open
Infrox opened this issue Nov 25, 2020 · 2 comments
Open

Streaming to Discord voice channel? #339

Infrox opened this issue Nov 25, 2020 · 2 comments

Comments

@Infrox
Copy link

Infrox commented Nov 25, 2020

Hey,
I've been using ytdl-core library to stream youtube videos (audio) to a voice channel, but it stopped working, giving me 429 error, which made me move to youtube-dl which works (not sure how, in case my ip was blacklisted by youtube)

This is the code I currently have:

var video = yt(url,["--format=bestaudio,worstaudio"]);
 video.on('info', async function(info) {
	var dispatcher = data.voiceConnection
        .play(video)
        .on("finish", () => {
           nextsong();
        })
        .on("error", error => {
           console.error("Error while playing audio",error);
           nextsong();
        });
 });

The music plays for 20-30 secs, then throwing me the following error:

Error: ESOCKETTIMEDOUT
    at ClientRequest.<anonymous> (/root/app/node_modules/request/request.js:816:19)
    at Object.onceWrapper (events.js:421:28)
    at ClientRequest.emit (events.js:315:20)
    at TLSSocket.emitRequestTimeout (_http_client.js:784:9)
    at Object.onceWrapper (events.js:421:28)
    at TLSSocket.emit (events.js:327:22)
    at TLSSocket.Socket._onTimeout (net.js:483:8)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7) {
  code: 'ESOCKETTIMEDOUT',
  connect: false
}

From what I found, this is due to me not consuming the incoming stream. How could I pass the stream to the voice channel and consume it so the socket does not timeout?
Thanks for any help.

@Infrox Infrox changed the title How does one send the stream to Discord voice? Streaming to Discord voice channel? Nov 25, 2020
@M4X1MUS07
Copy link

Hey there. This is the exact issue I've been getting. Could you maybe provide your discord's username and tag so I could add you. Maybe we could figure out the way to fix this. I've been trying to fix it for like 2-3 days now.

@Infrox
Copy link
Author

Infrox commented Nov 30, 2020

Hey there. This is the exact issue I've been getting. Could you maybe provide your discord's username and tag so I could add you. Maybe we could figure out the way to fix this. I've been trying to fix it for like 2-3 days now.

It's nedaso#7777

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants