Cobalt instance cannot retrieve YouTube cookies #543

Open
opened 2025-11-09 09:52:05 -06:00 by GiteaMirror · 17 comments
Owner

Originally created by @lpwyz on GitHub (Nov 6, 2024).

problem description

I cloned the Cobalt project here and it is also running normally. At this point, I enabled incognito browsing mode and opened: https://www.google.com/device Then I ran npm to token: YouTube

After waiting for a few minutes, I kept getting the following error message:

image

your instance configuration

No response

Originally created by @lpwyz on GitHub (Nov 6, 2024). ### problem description I cloned the Cobalt project here and it is also running normally. At this point, I enabled incognito browsing mode and opened: https://www.google.com/device Then I ran npm to token: YouTube After waiting for a few minutes, I kept getting the following error message: <img width="1429" alt="image" src="https://github.com/user-attachments/assets/ce855e52-f2ef-4307-bd29-54c118776aca"> ### your instance configuration _No response_
GiteaMirror added the instance hosting help label 2025-11-09 09:52:05 -06:00
Author
Owner

@KwiatekMiki commented on GitHub (Nov 6, 2024):

you need to use pnpm, not npm, to install. it never told you to use npm.

https://pnpm.io/installation

@KwiatekMiki commented on GitHub (Nov 6, 2024): you need to use pnpm, not npm, to install. it never told you to use npm. https://pnpm.io/installation
Author
Owner

@lpwyz commented on GitHub (Nov 6, 2024):

https://www.google.com/device

Hello, please take a closer look at the image above. I can assure you that it is a dependency for pnpm install. I used both npm and pnpm, but it still doesn't work. I can confirm that my local cobalt project dependency has been installed. Is there a problem with my steps? Here are my specific steps,
(1) After pulling the cobalt project, pnpm install installs dependencies
(2) Open Google Chrome in incognito mode and enter the address: https://www.google.com/device
(3) Open a new window in incognito Google Chrome, go to www.youtube.com, and log in to your account
(4) Running in the cobalt project API directory: npm run token: YouTube

Is there any problem with my steps above

@lpwyz commented on GitHub (Nov 6, 2024): > https://www.google.com/device Hello, please take a closer look at the image above. I can assure you that it is a dependency for pnpm install. I used both npm and pnpm, but it still doesn't work. I can confirm that my local cobalt project dependency has been installed. Is there a problem with my steps? Here are my specific steps, (1) After pulling the cobalt project, pnpm install installs dependencies (2) Open Google Chrome in incognito mode and enter the address: https://www.google.com/device (3) Open a new window in incognito Google Chrome, go to www.youtube.com, and log in to your account (4) Running in the cobalt project API directory: npm run token: YouTube Is there any problem with my steps above
Author
Owner

@lpwyz commented on GitHub (Nov 6, 2024):

image
@lpwyz commented on GitHub (Nov 6, 2024): <img width="1347" alt="image" src="https://github.com/user-attachments/assets/ace7ba83-f4b9-445f-90dc-f7ae61b599ea">
Author
Owner

@lpwyz commented on GitHub (Nov 6, 2024):

And I found that every time I input:

https://www.google.com/device Afterwards, the address will change to:

https://accounts.google.com/o/oauth2/device/usercode?ddm=1&flowName=DeviceOAuth

@lpwyz commented on GitHub (Nov 6, 2024): And I found that every time I input: https://www.google.com/device Afterwards, the address will change to: https://accounts.google.com/o/oauth2/device/usercode?ddm=1&flowName=DeviceOAuth
Author
Owner

@dumbmoron commented on GitHub (Nov 6, 2024):

what’s happening here is that the request made to youtube is timing out. you could try increasing the timeout for requests by adding this to the top of api/src/util/generate-youtube-tokens.js:

import { Agent, setGlobalDispatcher } from 'undici';

setGlobalDispatcher(new Agent({
    connect: { timeout: 60000 }
}));
@dumbmoron commented on GitHub (Nov 6, 2024): what’s happening here is that the request made to youtube is timing out. you could try increasing the timeout for requests by adding this to the top of `api/src/util/generate-youtube-tokens.js`: ```js import { Agent, setGlobalDispatcher } from 'undici'; setGlobalDispatcher(new Agent({ connect: { timeout: 60000 } })); ```
Author
Owner

@lpwyz commented on GitHub (Nov 6, 2024):

what’s happening here is that the request made to youtube is timing out. you could try increasing the timeout for requests by adding this to the top of api/src/util/generate-youtube-tokens.js:

import { Agent, setGlobalDispatcher } from 'undici';

setGlobalDispatcher(new Agent({
    connect: { timeout: 60000 }
}));
image Hello, I added the method you mentioned above, but still cannot obtain cookies. Is it because I am in China, but I have a VPN that allows me to browse YouTube and access foreign websites? So it's strange
@lpwyz commented on GitHub (Nov 6, 2024): > what’s happening here is that the request made to youtube is timing out. you could try increasing the timeout for requests by adding this to the top of `api/src/util/generate-youtube-tokens.js`: > > ```js > import { Agent, setGlobalDispatcher } from 'undici'; > > setGlobalDispatcher(new Agent({ > connect: { timeout: 60000 } > })); > ``` <img width="1557" alt="image" src="https://github.com/user-attachments/assets/d4318bc5-306e-46ac-8a2f-97d116c307c2"> Hello, I added the method you mentioned above, but still cannot obtain cookies. Is it because I am in China, but I have a VPN that allows me to browse YouTube and access foreign websites? So it's strange
Author
Owner

@lpwyz commented on GitHub (Nov 7, 2024):

Can someone help me? Paid consultation is also possible

@lpwyz commented on GitHub (Nov 7, 2024): Can someone help me? Paid consultation is also possible
Author
Owner

@lostdusty commented on GitHub (Nov 7, 2024):

i suspect that node isnt using the vpn connection

@lostdusty commented on GitHub (Nov 7, 2024): i suspect that node isnt using the vpn connection
Author
Owner

@lostdusty commented on GitHub (Nov 7, 2024):

here is something i found: https://stackoverflow.com/a/32055112

in other words, how is your vpn connection managed? what service are you using?

@lostdusty commented on GitHub (Nov 7, 2024): here is something i found: https://stackoverflow.com/a/32055112 in other words, how is your vpn connection managed? what service are you using?
Author
Owner

@lpwyz commented on GitHub (Nov 7, 2024):

I am very troubled. The VPN I am using with Clashx has already set up a global connection and entered the command in the terminal management:

export http_proxy= http://127.0.0.1:7890
export https_proxy= http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7890

But even after running it, it still shows that I can't get YouTube or cookies, and I'm a little suspicious of myself.

@lpwyz commented on GitHub (Nov 7, 2024): I am very troubled. The VPN I am using with Clashx has already set up a global connection and entered the command in the terminal management: export http_proxy= http://127.0.0.1:7890 export https_proxy= http://127.0.0.1:7890 export all_proxy=socks5://127.0.0.1:7890 But even after running it, it still shows that I can't get YouTube or cookies, and I'm a little suspicious of myself.
Author
Owner

@lpwyz commented on GitHub (Nov 7, 2024):

Can anyone make a video for me to learn

@lpwyz commented on GitHub (Nov 7, 2024): Can anyone make a video for me to learn
Author
Owner

@wukko commented on GitHub (Nov 7, 2024):

i think your proxy times out youtube, this is what the error suggests

@wukko commented on GitHub (Nov 7, 2024): i think your proxy times out youtube, this is what the error suggests
Author
Owner

@lpwyz commented on GitHub (Nov 7, 2024):

我认为你的代理超时了 youtube,这是错误提示

Do you have a recommended VPN? I'll give it a try

@lpwyz commented on GitHub (Nov 7, 2024): > 我认为你的代理超时了 youtube,这是错误提示 Do you have a recommended VPN? I'll give it a try
Author
Owner

@lostdusty commented on GitHub (Nov 7, 2024):

you could try openvpn

@lostdusty commented on GitHub (Nov 7, 2024): you could try openvpn
Author
Owner

@wukko commented on GitHub (Nov 7, 2024):

pretty sure regular protocols are blocked in china

@wukko commented on GitHub (Nov 7, 2024): pretty sure regular protocols are blocked in china
Author
Owner

@lpwyz commented on GitHub (Nov 7, 2024):

很确定常规协议在中国被屏蔽了

Got it, is that there's no way to open a VPN

@lpwyz commented on GitHub (Nov 7, 2024): > 很确定常规协议在中国被屏蔽了 Got it, is that there's no way to open a VPN
Author
Owner

@lpwyz commented on GitHub (Nov 7, 2024):

很确定常规协议在中国得到了增强

明白了,就是没办法开通VPN

Is it true that even if I open a VPN in China, there's no way, right?

@lpwyz commented on GitHub (Nov 7, 2024): > > 很确定常规协议在中国得到了增强 > > 明白了,就是没办法开通VPN Is it true that even if I open a VPN in China, there's no way, right?
Sign in to join this conversation.