mirror of
https://github.com/imputnet/cobalt.git
synced 2026-03-09 15:24:14 -05:00
[YouTube / Self-Hosting] Cookie question #819
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @iambtshft on GitHub (May 2, 2025).
Question
Has anyone succeeded in setting up own instance with custom cookie for YouTube?
What I tried
Self hosted instance behind residential proxy, see Instance configuration.
I exported cookies from private browser session using this fork https://github.com/sertraline/Get-cookies.txt-LOCALLY-Cobalt?tab=readme-ov-file
And got a
cookies.jsonwith something likeWhen I try to download any video using this setup I receive
Container output
If I remove cookies (comment out
COOKIE_PATH) - everything works just fine. Am I missing something?Instance configuration
@ansharyan03 commented on GitHub (May 4, 2025):
according to the latest commit logs YouTube cookies don't work anymore, I'm also using a residential proxy and get api.fetch.fail errors when using a session server hosted on my own computer so I'm also actively looking for a solution.
@iambtshft commented on GitHub (May 12, 2025):
I see that original session generator is deprecated as YouTube has changed the validation.
https://github.com/iv-org/youtube-trusted-session-generator?tab=readme-ov-file#tool-is-deprecated
@ansharyan03 commented on GitHub (May 14, 2025):
you just saved my life. invidious companion works with my proxy!
@TheK098 commented on GitHub (May 26, 2025):
@ansharyan03 do you mind sharing the instance configuration you used?
@ansharyan03 commented on GitHub (May 27, 2025):
i'm actually no longer using the same configuration since we have to use invidious companion now, i'm backlogged with other stuff but currently trying to figure out how to load in bytes from the mp4 audio in a reasonable amount of time since the links you get from invidious companion seem to be optimal for loading chunks in parallel which i'm trying to figure out.
using invidious companion with a server api key and my https url for my proxy as the proxy environment variable, running deno dev server for now but will look into building the container with docker compose later when i actually figure out the link streaming
info here
https://github.com/iv-org/invidious-companion/wiki
@ansharyan03 commented on GitHub (May 27, 2025):
before i had a session server and a proxy configured with env variables in my docker compose and the proxy would make it fail and i was tunneling my session server with http using ngrok to help my teammates access it temporarily
@iambtshft commented on GitHub (May 27, 2025):
I had a quick look on companion but didn't find any easy way to get po_token, so there is no direct replacement session generator -> companion.
Another (potentially) working replacement for session generator is https://github.com/Brainicism/bgutil-ytdlp-pot-provider. It's mentioned on yt-dlp guide on PO token and provides docker container with API for PO Token generation. The only thing - it needs VISITOR_DATA / video id to correctly generate token. So might also not work without an additional changes on cobalt side.
@mustfaunlu commented on GitHub (May 28, 2025):
same issue
@TheK098 commented on GitHub (May 28, 2025):
Since the original session generator is deprecated, does anyone know what cobat tools is currently using to get these PO tokens? Or who we can ask to figure this out?
@wukko commented on GitHub (May 28, 2025):
cobalt is still using the same session generator, you can use our fork without any changes, if you wish: https://github.com/imputnet/yt-session-generator
@Gareryer commented on GitHub (May 28, 2025):
The YT Session Generator seems not to be working perfectly, though.
With the above setup i keep getting this error
@MCJack123 commented on GitHub (Jun 5, 2025):
Having the same issue on my instance, set up the session token generator & imported cookies, but still getting the API error described above. I'm using a DigitalOcean VPS without a residential proxy (yet), but it's showing the API error instead of login error, so I doubt that's the issue here.
@Gareryer commented on GitHub (Jun 7, 2025):
Try this YAML
@martipartydev commented on GitHub (Sep 9, 2025):
what proxy provider are you using, also how much trafic is going thru your proxy