[GH-ISSUE #816] empty downloaded file from youtube #6353

Closed
opened 2026-04-19 08:26:13 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @2shiraz on GitHub (Oct 6, 2024).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/816

problem description

I was thinking of using a proxy instead of cookies (since making new accounts other day is becoming really hard), but when I tried this in my local environment, without cookies, the downloaded file ends up as an empty 0-byte file. The same happens when I use a proxy.

I tested the proxy, and it seems to work because, when I don't use the proxy on a server (with a data center IP), I get a youtube login error. But when I use the proxy, there's no login error anymore. However, the downloaded file is still empty.

I noticed that when using cookies, the YouTube info I logged shows that the download links ( those googlevideo.com links ) work, but without a proxy or without cookies, the links return a 403 error.

I am using cobalt v10.0.0

UPDATE: I tested the proxy more on my phone and pc and youtube is working perfectly fine.

tldr: without using cookies youtube downloading doesn't give any API error but an empty file is received ( 0-bytes )

my instance configuration

API_URL=http://localhost:9000/
API_PORT=9000
API_NAME=local
API_EXTERNAL_PROXY=http://user:pass@ip:port
Originally created by @2shiraz on GitHub (Oct 6, 2024). Original GitHub issue: https://github.com/imputnet/cobalt/issues/816 ### problem description I was thinking of using a proxy instead of cookies (since making new accounts other day is becoming really hard), but when I tried this in my local environment, without cookies, the downloaded file ends up as an empty 0-byte file. The same happens when I use a proxy. I tested the proxy, and it seems to work because, when I don't use the proxy on a server (with a data center IP), I get a youtube login error. But when I use the proxy, there's no login error anymore. However, the downloaded file is still empty. I noticed that when using cookies, the YouTube info I logged shows that the download links ( those googlevideo.com links ) work, but without a proxy or without cookies, the links return a 403 error. I am using cobalt v10.0.0 UPDATE: I tested the proxy more on my phone and pc and youtube is working perfectly fine. **tldr:** without using cookies youtube downloading doesn't give any API error but an empty file is received ( 0-bytes ) ### my instance configuration ```shell API_URL=http://localhost:9000/ API_PORT=9000 API_NAME=local API_EXTERNAL_PROXY=http://user:pass@ip:port ```
GiteaMirror added the instance hosting help label 2026-04-19 08:26:13 -05:00
Author
Owner

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

you need to use cookies

<!-- gh-comment-id:2395470267 --> @KwiatekMiki commented on GitHub (Oct 6, 2024): you need to use cookies
Author
Owner

@2shiraz commented on GitHub (Oct 6, 2024):

you need to use cookies

yeah that's what I am currently doing but can't we use proxy to do the same thing as using ISP proxy doesn't give Youtube login error ( youtube seems to work )

<!-- gh-comment-id:2395471216 --> @2shiraz commented on GitHub (Oct 6, 2024): > you need to use cookies yeah that's what I am currently doing but can't we use proxy to do the same thing as using ISP proxy doesn't give Youtube login error ( youtube seems to work )
Author
Owner

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

youtube probably changed something

<!-- gh-comment-id:2395472679 --> @KwiatekMiki commented on GitHub (Oct 6, 2024): youtube probably changed something
Author
Owner

@2shiraz commented on GitHub (Oct 6, 2024):

Strangely i got it fixed by changing the client from IOS to always using ANDROID

info = await yt.getBasicInfo(o.id, 'ANDROID'); in /api/src/processing/services/youtube.js

I don't know why IOS client was there but this fixed for me.

@wukko was there is any specific reason you were using IOS client when there was no youtube session present as I don't want to break the downloader in long term.

<!-- gh-comment-id:2395503888 --> @2shiraz commented on GitHub (Oct 6, 2024): Strangely i got it fixed by changing the client from IOS to always using ANDROID `info = await yt.getBasicInfo(o.id, 'ANDROID');` in `/api/src/processing/services/youtube.js` I don't know why IOS client was there but this fixed for me. @wukko was there is any specific reason you were using IOS client when there was no youtube session present as I don't want to break the downloader in long term.
Author
Owner

@hextor1 commented on GitHub (Nov 27, 2024):

@2shiraz Hello bro i have same issue in my side can you help me when i click to donwload button 0 byte file is downlaod my site is based on django

<!-- gh-comment-id:2504717436 --> @hextor1 commented on GitHub (Nov 27, 2024): @2shiraz Hello bro i have same issue in my side can you help me when i click to donwload button 0 byte file is downlaod my site is based on django
Author
Owner

@CircuitTear commented on GitHub (Dec 4, 2024):

I have the same issue but on the main server

<!-- gh-comment-id:2516017754 --> @CircuitTear commented on GitHub (Dec 4, 2024): I have the same issue but on the main server
Sign in to join this conversation.