Skip to content
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

YouTube OAuth2 tokens no longer work #942

Open
coderonex opened this issue Nov 25, 2024 · 29 comments
Open

YouTube OAuth2 tokens no longer work #942

coderonex opened this issue Nov 25, 2024 · 29 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@coderonex
Copy link

problem description

Newly registered youtube account, getting cookies that don't work?

your instance configuration

No response

@coderonex
Copy link
Author

image

@hazycora
Copy link

hazycora commented Nov 25, 2024

I got this too on an account made a week ago, it used to work and then this started happening yesterday. Would love to provide logs but there's nothing in the server's console. Don't know if this is normal, but playing videos through the YouTube site doesn't have this problem on the account- maybe it's just unable to make YouTube TV sessions, or something.

Trying a much older (but still unused, not my main account don't worry!) account, this doesn't happen, so it seems maybe banned accounts get a different error response now?

@hextor1
Copy link

hextor1 commented Nov 26, 2024

I have the same error on my new created accounts. basically I have 5 gmail acocunt on 50 youtube channel created on these gmails. from yesterday i am facing this error. even i did not face any error before like this

unexpected status: error (error.api.youtube.api_error)

@wukko wukko changed the title Newly registered youtube account, getting cookies that don't work? YouTube OAuth2 tokens sometimes don't work Nov 26, 2024
@wukko
Copy link
Member

wukko commented Nov 26, 2024

as far as i can tell, youtube is slowly rolling out a change that breaks oauth2 tokens for clients other than youtube tv (cobalt uses android & ios). not all accounts are affected yet, but an increasingly higher amount of them is. the main cobalt instance is also affected.

we don't know of a proper fix at the moment, but you can follow the same issue in youtube.js' repo: LuanRT/YouTube.js#803 or read the history of the issue in yt-dlp's repo (they ended up removing oauth2 support): yt-dlp/yt-dlp#11462

@Chidubemmo
Copy link

Dude I just want to listen to Chromakopia in Bomb Rush Cyberfunk 😭 I hate YouTube so much

@wukko wukko changed the title YouTube OAuth2 tokens sometimes don't work YouTube OAuth2 tokens no longer work Nov 27, 2024
@wukko
Copy link
Member

wukko commented Nov 27, 2024

youtube is slowly rolling out a change that breaks oauth2 tokens

oauth2 tokens are completely cooked now, the change was fully rolled out. not sure what to do from now on aside from adding support for web cookies, but those are very short lasting :(

@hextor1
Copy link

hextor1 commented Nov 27, 2024

@wukko You mean cookies will not work in future? :(
from my side proxies is also not worked when I try to download the songs with proxy donwlaod 0 byte file

@MC-shark

This comment was marked as duplicate.

@wukko wukko added bug Something isn't working help wanted Extra attention is needed and removed instance hosting help labels Nov 28, 2024
@asepsunarya

This comment was marked as duplicate.

@coderonex
Copy link
Author

Is there a new solution? @wukko
FoxxMD/multi-scrobbler#236 (comment)

@hextor1
Copy link

hextor1 commented Dec 4, 2024

FoxxMD/multi-scrobbler#236 (comment)
Yes its working with other library if we use.

@lpwyz
Copy link

lpwyz commented Dec 10, 2024

YouTube 正在慢慢推出一项破坏 oauth2 令牌的变更

oauth2 令牌现在已经完全成熟,变更已全面推出。除了添加对网络 cookie 的支持外,不确定从现在开始还能做什么,但这些 cookie 的持续时间很短 :(
Hello, do you have a plan to integrate Cobalt project settings with YouTube's Oauth2? The cookies generated by the new Google account are no longer able to access and download YouTube videos

@ZEREX222
Copy link

also have the same issue with a new account. do we still not have a solution?
image

@arman-async
Copy link

also have the same issue with a new account. do we still not have a solution? image

I have the exact same problem. Did you manage to solve it?
Please guide me too.

@moeinrahimi1
Copy link

how is it that cobalt.tools can download youtube videos but not self hosted one?

@andreioprisan
Copy link

I'm still running into this issue with a self-hosted instance. Has anyone been able to get this working?

@wukko
Copy link
Member

wukko commented Jan 3, 2025

@moeinrahimi1 we don’t use accounts anymore, which is why it works fine

we already implemented support for web cookies, an alternative way of using accounts for “bad reputation” ips. will update the documentation very soon!

@georgeollis
Copy link

Thank you @wukko. Look forward to the new documentation for using cookies instead of user accounts.

@coderonex
Copy link
Author

@moeinrahimi1 we don’t use accounts anymore, which is why it works fine

we already implemented support for web cookies, an alternative way of using accounts for “bad reputation” ips. will update the documentation very soon!

Can you update the docs first, really need your support!

@CoderHyve51
Copy link

also have the same issue with a new account. do we still not have a solution? image

I am encountering the same issue as well. I just created a new Google account today to fetch the YouTube OAuth cookies as instructed by the pnpm run token:youtube command.

Now, when I tried to make a YouTube request, it returns the same frustrating error everyone here faces.

{
"status": "error",
"error": {
"code": "error.api.youtube.api_error"
}
}

Is there any solution out there to this problem?

@georgeollis
Copy link

Does anyone know what the new configuration for YouTube should be? I've got a private instance running and would like to get YouTube up and running again. Thanks!

@CoderickLamar
Copy link

@moeinrahimi1 we don’t use accounts anymore, which is why it works fine

What are you using instead of accounts?

@pseudoseed
Copy link

Seems like everyone is impacted by this change. Safe to say oauth will no longer work for this?

@wukko wukko unpinned this issue Jan 31, 2025
@DanteMS
Copy link

DanteMS commented Feb 2, 2025

Just remove any YouTube cookies. It works without them, unless your IP is blocked.

@sertraline
Copy link

Does anyone know what the new configuration for YouTube should be? I've got a private instance running and would like to get YouTube up and running again. Thanks!

You can put youtube cookies directly in your cookies.json and it will work. No need for auth token.

@sertraline
Copy link

I was tired of editing cookies manually so I've made a fork of a Chrome extension. This extension works locally. It will export (or copy) domain cookies in a format cookie=value;another_cookie=value; that Cobalt can read, so you can quickly copy and paste it into your cookies.json file.

On my instance I have:

{
  "youtube": ["youtube cookies"]
}

And "youtube-cookies" are copied cookies from my public Youtube account that I've made specifically for Youtube downloads.

@hextor1
Copy link

hextor1 commented Feb 13, 2025

I was tired of editing cookies manually so I've made a fork of a Chrome extension. This extension works locally. It will export (or copy) domain cookies in a format cookie=value;another_cookie=value; that Cobalt can read, so you can quickly copy and paste it into your cookies.json file.

On my instance I have:

{
  "youtube": ["youtube cookies"]
}

And "youtube-cookies" are copied cookies from my public Youtube account that I've made specifically for Youtube downloads.

Please can you tell me how to find cookies from personal youtube account and also let me know did you give the cookies path in docker compose file???

@lancer1256
Copy link

@wukko How do you keep it working so consistently at the scale you serve on the main cobalt site without getting flagged w/bot protection? (saw you mentioned 150k daily visitors in discord!) it is super impressive

are you guys using cookies on the main cobalt site and/or distributing requests from a ton of different ip addresses to keep volume per ip low?

@shengchenyang
Copy link

I was tired of editing cookies manually so I've made a fork of a Chrome extension. This extension works locally. It will export (or copy) domain cookies in a format cookie=value;another_cookie=value; that Cobalt can read, so you can quickly copy and paste it into your cookies.json file.

On my instance I have:

{
  "youtube": ["youtube cookies"]
}

And "youtube-cookies" are copied cookies from my public Youtube account that I've made specifically for Youtube downloads.

I ran it successfully.I can get the resolved url, but I still get a 0 bytes file when I download it using an ip with bad reputation.
It seems that the cookie does not take effect when downloading?Have you tested this situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests