cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

YouTube OAuth2 tokens no longer work

Open coderonex opened this issue 1 year ago • 20 comments

problem description

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

your instance configuration

No response

coderonex avatar Nov 25 '24 07:11 coderonex

image

coderonex avatar Nov 25 '24 07:11 coderonex

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?

hazycora avatar Nov 25 '24 10:11 hazycora

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)

hextor1 avatar Nov 26 '24 08:11 hextor1

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: https://github.com/LuanRT/YouTube.js/issues/803 or read the history of the issue in yt-dlp's repo (they ended up removing oauth2 support): https://github.com/yt-dlp/yt-dlp/issues/11462

wukko avatar Nov 26 '24 11:11 wukko

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

Chidubemmo avatar Nov 26 '24 18:11 Chidubemmo

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 :(

wukko avatar Nov 27 '24 10:11 wukko

@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

hextor1 avatar Nov 27 '24 10:11 hextor1

same here

MC-shark avatar Nov 28 '24 03:11 MC-shark

same here

asepsunarya avatar Nov 29 '24 01:11 asepsunarya

Is there a new solution? @wukko https://github.com/FoxxMD/multi-scrobbler/pull/236#issue-2715968493

coderonex avatar Dec 04 '24 02:12 coderonex

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

hextor1 avatar Dec 04 '24 04:12 hextor1

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

lpwyz avatar Dec 10 '24 02:12 lpwyz

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

ZEREX222 avatar Dec 21 '24 18:12 ZEREX222

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.

arman-async avatar Dec 28 '24 19:12 arman-async

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

moeinrahimi1 avatar Jan 03 '25 00:01 moeinrahimi1

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

andreioprisan avatar Jan 03 '25 02:01 andreioprisan

@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!

wukko avatar Jan 03 '25 04:01 wukko

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

georgeollis avatar Jan 03 '25 11:01 georgeollis

@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!

coderonex avatar Jan 12 '25 03:01 coderonex

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?

CoderHyve51 avatar Jan 13 '25 20:01 CoderHyve51

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!

georgeollis avatar Jan 17 '25 09:01 georgeollis

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

What are you using instead of accounts?

CoderickLamar avatar Jan 23 '25 06:01 CoderickLamar

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

pseudoseed avatar Jan 28 '25 21:01 pseudoseed

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

DanteMS avatar Feb 02 '25 05:02 DanteMS

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 avatar Feb 12 '25 15:02 sertraline

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.

sertraline avatar Feb 12 '25 16:02 sertraline

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???

hextor1 avatar Feb 13 '25 20:02 hextor1

@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?

lancer1256 avatar Feb 21 '25 01:02 lancer1256

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?

shengchenyang avatar Feb 22 '25 05:02 shengchenyang

@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?

+1 curious to know.

Shabinder avatar Feb 22 '25 20:02 Shabinder