Empty file downloaded from youtube by selfhosted cobalt #414

Closed
opened 2025-11-09 09:48:51 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @FixFever on GitHub (Sep 3, 2024).

bug description

cobalt.tools successfully downloads videos from YouTube. But selfhosted solution downloads an empty file for any video from YouTube.

reproduction steps

docker-compose:

  cobalt_api:
    image: ghcr.io/imputnet/cobalt:latest
    container_name: cobalt_api
    ports:
      - 9002:9000/tcp
    environment:
      - API_URL=https://api.cobalt.${DOMAIN}/
      - RATELIMIT_WINDOW=21600
      - RATELIMIT_MAX=1000
      - DURATION_LIMIT=21600
      
  cobalt:
    image: ghcr.io/imputnet/cobalt:latest
    container_name: cobalt
    ports:
      - 9003:9001/tcp
    environment:
      - WEB_URL=https://cobalt.${DOMAIN}/
      - API_URL=https://api.cobalt.${DOMAIN}/

All quality and codec settings are similar to those in cobalt.tools.
Version similar: v.7.15-05ba1f0 (current)
Trying download any video from youtube from cobalt.tools and selfhosted app.

screenshots

Screenshot_13

Originally created by @FixFever on GitHub (Sep 3, 2024). ### bug description cobalt.tools successfully downloads videos from YouTube. But selfhosted solution downloads an empty file for any video from YouTube. ### reproduction steps docker-compose: ``` cobalt_api: image: ghcr.io/imputnet/cobalt:latest container_name: cobalt_api ports: - 9002:9000/tcp environment: - API_URL=https://api.cobalt.${DOMAIN}/ - RATELIMIT_WINDOW=21600 - RATELIMIT_MAX=1000 - DURATION_LIMIT=21600 cobalt: image: ghcr.io/imputnet/cobalt:latest container_name: cobalt ports: - 9003:9001/tcp environment: - WEB_URL=https://cobalt.${DOMAIN}/ - API_URL=https://api.cobalt.${DOMAIN}/ ``` All quality and codec settings are similar to those in cobalt.tools. Version similar: v.7.15-05ba1f0 (current) Trying download any video from youtube from cobalt.tools and selfhosted app. ### screenshots ![Screenshot_13](https://github.com/user-attachments/assets/00f2a8af-8f4b-4ca1-864c-5f67fa4619e3)
GiteaMirror added the bug label 2025-11-09 09:48:51 -06:00
Author
Owner

@KwiatekMiki commented on GitHub (Sep 3, 2024):

Set up cookies for YouTube.

https://github.com/imputnet/cobalt/issues/687#issuecomment-2293405845

@KwiatekMiki commented on GitHub (Sep 3, 2024): Set up cookies for YouTube. https://github.com/imputnet/cobalt/issues/687#issuecomment-2293405845
Author
Owner

@FixFever commented on GitHub (Oct 12, 2024):

Just adding cookies didn't help. In addition to adding cookies, downloading from YouTube worked when changing the file /app/src/modules/processing/services/youtube.js:
change info = await yt.getBasicInfo(o.id, yt.session.logged_in ? 'ANDROID' : 'IOS');
to info = await yt.getBasicInfo(o.id, 'ANDROID');
I dont know why, but it works

@FixFever commented on GitHub (Oct 12, 2024): Just adding cookies didn't help. In addition to adding cookies, downloading from YouTube worked when changing the file /app/src/modules/processing/services/youtube.js: change `info = await yt.getBasicInfo(o.id, yt.session.logged_in ? 'ANDROID' : 'IOS');` to `info = await yt.getBasicInfo(o.id, 'ANDROID');` I dont know why, but it works
Author
Owner

@wukko commented on GitHub (Oct 13, 2024):

are you sure the cookie file path is correct?

@wukko commented on GitHub (Oct 13, 2024): are you sure the cookie file path is correct?
Author
Owner

@wukko commented on GitHub (Oct 13, 2024):

but yeah, i think we should make android client the only default @dumbmoron

@wukko commented on GitHub (Oct 13, 2024): but yeah, i think we should make android client the only default @dumbmoron
Sign in to join this conversation.