Closed SimplyJustDanny closed 3 months ago
@SimplyJustDanny few things to clarify here,
if things don't meet the expectation, it is most likely the youtube library's fault here. We follow a common pattern. Unless we are doing it in a wrong way, discord-player has nothing to do with this issue.
And I see you are using @distubejs' ytdl-core which seems to expect a new cookie format (this might be the problem, plus I am totally okay with it being different from all other alternative youtube libraries as it is scoped to distubejs), it will be harder to keep track of which package uses which format as our goal is to provide singular api for everything. This can be difficult from a user's pov as well. If all these libs expect different format of cookie, I'd like to propose the addition of CredentialManager within discord-player to provide sensitive information such as tokens/cookies to the extractors.
Since you suggested the cookie format being different on distube's ytdl-core, I tried switching over to the basic one with youtube-ext to see if it's just an extractor problem, but the issue persists. Then I considered changing other packages like opus libraries, but that didn't seem to fix it either. I also tried updating discord-player to 6.6.8, but the songs couldn't even load. I understand that the issue is no longer the focus, but something I thought worth mentioning just in case. Thanks for the response either way.
This part needs a rework as it is confusing to interpret. For the time being, you should be able to pass json format of cookie just fine, but you may get typescript errors. Agent is automatically created when cookie is available. In other words, new format of cookie works with this youtube lib.
I am closing this issue in favor of https://github.com/Androz2091/discord-player/issues/1905
Describe the bug I have a personal bot that I host on a Replit repository for ease of access anywhere. Age-restricted content being pulled with the YouTube extractor seems to crash the bot entirely, despite having both personal cookies and ID token included in the header. This issue also occurs in my personal backup from VSCode, so it's not a cloud-based issue.
To Reproduce Steps to reproduce the behavior:
Expected behavior (ID_TOKEN censored) That the YouTube video be extracted normally or that a more explicit error code were given, but instead it just says that "stream could not be extracted." I was also expecting that the crash occurs when the video is added to the bot in any capacity, but strangely, it gets stored into the queue just fine. Once the bot actually tries playing it, though, it crashes.
Screenshots
![image](https://github.com/Androz2091/discord-player/assets/47044155/b84e37bc-c509-4c30-b2a7-d9f8a22a4f2f)
Please complete the following information:
Additional context I had been trying to resolve this issue for a few weeks now and it seems most of the solutions that I was provided were unfruitful. Cookie implementation seems to match what I checked in the discord-player.js guide, what I checked in other GitHub issues, and what I was informed. in the official Discord for the framework. I was advised to move it here to parse if this correlates to any possible bugs.