ZerioDev / Music-bot

A complete code to download for a cool Discord music bot !
https://discord.gg/5cGSYV8ZZj
GNU General Public License v3.0
882 stars 1.08k forks source link

Error when playing a song #264

Closed itsjustyryr closed 1 year ago

itsjustyryr commented 1 year ago

Even though the bot is in the beta stage, I've took my time to find a issue:

const error = new Error("Could not extract stream for this track"); ^ Error: Could not extract stream for this track at GuildQueuePlayerNode.play (C:\Users\Users\Desktop\bot\node_modules\discord-player\dist\index.js:985:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.execute (C:\Users\User\Desktop\bot\commands\music\play.js:58:33)

Versions:

Node.js v18.12.1 discord-player v6.1.1

CaptSpider4 commented 1 year ago

skipOnNoStream: true

this option in queue creation should fix this issue

Note: It doesn't make bot play song it will just not throw this error

This error is possibly due to play age restricted or region restricted songs this could also be due to https://github.com/Androz2091/discord-player/issues/1705

itsjustyryr commented 1 year ago

skipOnNoStream: true

this option in queue creation should fix this issue

Note: It doesn't make bot play song it will just not throw this error

This error is possibly due to play age restricted or region restricted songs this could also be due to Androz2091/discord-player#1705

I've actually pasted a Spotify link in the command bar of the bot when using /play. The skipOnNoStream: true has to be added in config, even though it does not play the song? Maybe it should be replaced with play-dl, which means I might have to install play-dl, force it to use play-dl and rewrite the code. I might either launch it tommorow or another day

twlite commented 1 year ago

You don't have to rewrite your code, just add this environment variable DP_FORCE_YTDL_MOD="play-dl" in your .env file. Make sure you have play-dl installed though. You can also try using @distube/ytdl-core (DP_FORCE_YTDL_MOD="@distube/ytdl-core" & npm i @distube/ytdl-core)

itsjustyryr commented 1 year ago

You don't have to rewrite your code, just add this environment variable DP_FORCE_YTDL_MOD="play-dl" in your .env file. Make sure you have play-dl installed though. You can also try using @distube/ytdl-core (DP_FORCE_YTDL_MOD="@distube/ytdl-core" & npm i @distube/ytdl-core)

Where is the .env file? Is it found in the main page? The config file? The modules folder? I will install both

Figured it out, added both play-dl and @distube/ytdl-core, I forced it to use either play-dl and ytdl-core, but it isn't working because of the discord-player

revot334 commented 1 year ago

fixed in beta