Closed Aayansh549 closed 3 years ago
Not sure about terminating this issue, but u can use the error event to handle this error. Also is it happening everytime u play song? What version of discord-player is it?
fent/node-ytdl-core#923
will do something about this in the next release
Because of that error sometimes song also not start to play. That's not always done when trackAdded it's random and it's showing on play song or track or whatever. Not always. I'm using V4.1.1 of discord-player.
@Aayansh549 This is a bug in ytdl-core itself
I have also encountered this bug just now.
Can you guys try using https://www.npmjs.com/package/@discord-player/downloader 🤔
Also, do npm install discord-player@beta
before using that
Can you guys try using https://www.npmjs.com/package/@discord-player/downloader 🤔 Also, do
npm install discord-player@beta
before using that
I got err with no stream source provided. Just install discord-player@beta and use player.use for extractor.
Can you guys try using https://www.npmjs.com/package/@discord-player/downloader 🤔 Also, do
npm install discord-player@beta
before using thatI got err with no stream source provided. Just install discord-player@beta and use player.use for extractor.
yeah that was my fault by not exporting stream engine. Can you install the extractor again? The latest version??
Can you guys try using https://www.npmjs.com/package/@discord-player/downloader 🤔 Also, do
npm install discord-player@beta
before using thatI got err with no stream source provided. Just install discord-player@beta and use player.use for extractor.
yeah that was my fault by not exporting stream engine. Can you install the extractor again? The latest version??
Discord-player downloader?
npm install discord-player@latest
npm install @discord-player/downloader@latest
// after client.player = new Player(client)
client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader);
// in your play command
const { Util } = require("discord-player");
if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true });
const tracks = await Util.ytSearch(args.join(" "), {
user: message.author,
player: client.player
}).catch(() => {});
if (!tracks || !tracks.length) return message.channel.send("Track not found!");
client.player.play(message, tracks[0].url, { firstResult: true });
You need to handle playlists in similar way. Else you may get status code 404
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
Thank you! It's works perfectly, but one problem is when I use discord extractor module along with discord-player it's a little bit slow than before, (I using replit), but anyway, It's work!
After adding this, still causes a 404 error.
One more problem which I notice that I can't loop a track, it's saying memory leak problem, trying to enable emitter.setMaxListeners()
but still giving this warning on console.
(node:1351) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:1351) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
One more problem which I notice that I can't loop a track, it's saying memory leak problem, trying to enable
emitter.setMaxListeners()
but still giving this warning on console.(node:1351) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit (node:1351) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
This is due to hosting in repl
Oh, i got same error:
Yep
Oh, i got same error:
Same
Those who got the issue, you can use this temporary solution
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
yeah that works but the play needs like 1-2 minutes to play and some times the music is too laggy but works fine :)
After adding this, still causes a 404 error.
Same for me
After adding this, still causes a 404 error.
Same for me
Yes, same here
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
Everything is fine but how to get the filter work? And the pause?
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
This Fix Works but it messes with the livestream videos and Spotify playback
There is a PR in node-ytdl-core repo where it fixes the 404 problem better fork it and merge the commits manually As a temporary fix but that also crashes
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
This Fix Works but it messes with the livestream videos and Spotify playback
There is a PR in node-ytdl-core repo where it fixes the 404 problem better fork it and merge the commits manually As a temporary fix but that also crashes
For me this fix doesn't fix anything. The bot continues to throw a 404 error after it was given a youtube link.
how to fix this in repl.it?
how to fix this in repl.it?
temporary solution works in replit.com too
but can appear eventEmitter error (above someone posted it)
For users can edit node_modules go to node_modules/ytld-core/lib/info.js
, delete and paste this code
For replit users can use this method:
- Create a file info.js and copy/paste this code
- Put the following code into index.js or the main node file
try { let file = fs.readFileSync(__dirname + "/info.js"); fs.writeFileSync(__dirname + "/node_modules/ytdl-core/lib/info.js", file); } catch (error) { console.log(error); }
- Restart and ready
EDIT:
$ npm install fs
const fs = require('fs');
I hope works for you
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
It's working, thanks a lot!
For users can edit node_modules go to
node_modules/ytld-core/lib/info.js
, delete and paste this codeFor replit users can use this method
- Create a file info.js and copy/paste this code
- Put the following code into index.js or the main node file
try { let file = fs.readFileSync(__dirname + "/info.js"); fs.writeFileSync(__dirname + "/node_modules/ytdl-core/lib/info.js", file); } catch (error) { console.log(error); }
(Remember install and define fs module)
- Restart and ready
I hope works for you
worksss!!! fast than the temporary solution (everyone reading this, try this :D) i tried it in replit.
For users can edit node_modules go to
node_modules/ytld-core/lib/info.js
, delete and paste this codeFor replit users can use this method
- Create a file info.js and copy/paste this code
- Put the following code into index.js or the main node file
try { let file = fs.readFileSync(__dirname + "/info.js"); fs.writeFileSync(__dirname + "/node_modules/ytdl-core/lib/info.js", file); } catch (error) { console.log(error); }
(Remember install and define fs module)
- Restart and ready
I hope works for you
Thanks !
same here fixed it for me after changing the file.
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
This Fix Works but it messes with the livestream videos and Spotify playback
There is a PR in node-ytdl-core repo where it fixes the 404 problem better fork it and merge the commits manually As a temporary fix but that also crashes
For me this fix doesn't fix anything. The bot continues to throw a 404 error after it was given a youtube link.
With this temporary solution, the seek , filter, repeate mode is not working. Any one face this issue?
Run
npm install discord-player@latest
npm install @discord-player/downloader@latest
Update
// after client.player = new Player(client) client.player.use("YOUTUBE_DL", require("@discord-player/downloader").Downloader); // in your play command const { Util } = require("discord-player"); if (Util.isURL(args.join(" "))) return client.player.play(message, args.join(" "), { firstResult: true }); const tracks = await Util.ytSearch(args.join(" "), { user: message.author, player: client.player }).catch(() => {}); if (!tracks || !tracks.length) return message.channel.send("Track not found!"); client.player.play(message, tracks[0].url, { firstResult: true });
This did not work for me. I followed this exactly and I'm still getting the 404 error.
Para que os usuários possam editar node_modules, vá para
node_modules/ytld-core/lib/info.js
, exclua e cole este código Para usuários substitutos pode usar este método
- Crie um arquivo info.js e copie / cole este código
- Coloque o seguinte código em index.js ou no arquivo do nó principal
try { let file = fs.readFileSync(__dirname + "/info.js"); fs.writeFileSync(__dirname + "/node_modules/ytdl-core/lib/info.js", file); } catch (error) { console.log(error); }
(Remember install and define fs module)
- Reinicie e pronto
Espero que funcione para você
worksss !!! mais rápido do que a solução temporária (todos que estão lendo isso, tente isso: D) eu tentei em replit.
thanks bro <3
npm r @discord-player/downloader
npm i discord-player@latest
FIX
* `npm r @discord-player/downloader` * `npm i discord-player@latest`
works! i tried it in my second bot and worked, in the first one i tried that info.js solution from above, ty for fixing it this will result useful to people who waited this long using @discord-player/downloader
I'm getting status code 404 error. How can I terminate that or resolve that. It shows when track is added to the queue. Not sure when. It's generated but how can I resolve that.