[GH-ISSUE #1130] get 0 bytes file for youtube download with cookies #16323

Closed
opened 2026-06-01 14:20:22 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @hextor1 on GitHub (Feb 24, 2025).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/1130

bug description

problem description

I can use the bad reputation IP to get the download link normally with cookies.

But I get a 0 byte file when I download it.
It seems that the cookie does not take effect when downloading?

cookies.json example:

{
"youtube": ["key1=value;key2=value2"]
}

reproduction steps

services:
cobalt-api:
image: ghcr.io/imputnet/cobalt:10.7.5

    init: true
    read_only: true
    restart: unless-stopped
    container_name: cobalt-api

    ports:
        - 9000:9000/tcp

    environment:
        API_URL: "http://127.0.0.1:9000/"
        COOKIE_PATH: "/cookies.json"
        API_EXTERNAL_PROXY: "http://127.0.0.1:7897"

    labels:
        - com.centurylinklabs.watchtower.scope=cobalt

    volumes:
        - ./cookies.json:/cookies.json

watchtower:
    image: ghcr.io/containrrr/watchtower
    restart: unless-stopped
    command: --cleanup --scope cobalt --interval 900 --include-restarting
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock

screenshots

No response

links


platform information

Window os

additional context

No response

Originally created by @hextor1 on GitHub (Feb 24, 2025). Original GitHub issue: https://github.com/imputnet/cobalt/issues/1130 ### bug description problem description I can use the bad reputation IP to get the download link normally with cookies. But I get a 0 byte file when I download it. It seems that the cookie does not take effect when downloading? **cookies.json example:** { "youtube": ["key1=value;key2=value2"] } ### reproduction steps services: cobalt-api: image: ghcr.io/imputnet/cobalt:10.7.5 init: true read_only: true restart: unless-stopped container_name: cobalt-api ports: - 9000:9000/tcp environment: API_URL: "http://127.0.0.1:9000/" COOKIE_PATH: "/cookies.json" API_EXTERNAL_PROXY: "http://127.0.0.1:7897" labels: - com.centurylinklabs.watchtower.scope=cobalt volumes: - ./cookies.json:/cookies.json watchtower: image: ghcr.io/containrrr/watchtower restart: unless-stopped command: --cleanup --scope cobalt --interval 900 --include-restarting volumes: - /var/run/docker.sock:/var/run/docker.sock ### screenshots _No response_ ### links ```shell ``` ### platform information Window os ### additional context _No response_
GiteaMirror added the bug label 2026-06-01 14:20:22 -05:00
Author
Owner

@wukko commented on GitHub (Feb 24, 2025):

there are many types of ip-based restrictions, and in this case your server's ip got banned at googlevideo.com. currently cobalt uses cookies only for the initial (innertube) request, but cookies can't help with the googlevideo restriction as far as i'm aware.

<!-- gh-comment-id:2678121418 --> @wukko commented on GitHub (Feb 24, 2025): there are many types of ip-based restrictions, and in this case your server's ip got banned at googlevideo.com. currently cobalt uses cookies only for the initial (innertube) request, but cookies can't help with the googlevideo restriction as far as i'm aware.
Author
Owner

@hextor1 commented on GitHub (Feb 24, 2025):

@wukko My IP is working at the moment, but i see cookies not working directly access to googlevideo. I got your point. i am only accessing direct cobalt end-point and i am using youtube-search library for python project.

<!-- gh-comment-id:2678148915 --> @hextor1 commented on GitHub (Feb 24, 2025): @wukko My IP is working at the moment, but i see cookies not working directly access to googlevideo. I got your point. i am only accessing direct cobalt end-point and i am using youtube-search library for python project.
Author
Owner

@dumbmoron commented on GitHub (Feb 24, 2025):

cookies.json example:

{ "youtube": ["key1=value;key2=value2"] }

this is not how the cookies are formatted in the example file though

<!-- gh-comment-id:2678167487 --> @dumbmoron commented on GitHub (Feb 24, 2025): > **cookies.json example:** > > { "youtube": ["key1=value;key2=value2"] } this is not how the cookies are formatted in the example file though
Author
Owner

@hextor1 commented on GitHub (Feb 24, 2025):

cookies.json example:
{ "youtube": ["key1=value;key2=value2"] }

this is not how the cookies are formatted in the example file though

@dumbmoron can you tell me the cookies formated?

<!-- gh-comment-id:2678199394 --> @hextor1 commented on GitHub (Feb 24, 2025): > > **cookies.json example:** > > { "youtube": ["key1=value;key2=value2"] } > > this is not how the cookies are formatted in the example file though @dumbmoron can you tell me the cookies formated?
Author
Owner

@dumbmoron commented on GitHub (Feb 24, 2025):

you can read the file

<!-- gh-comment-id:2678201073 --> @dumbmoron commented on GitHub (Feb 24, 2025): you can read the file
Author
Owner

@hextor1 commented on GitHub (Feb 24, 2025):

WHich before you mentioned in the old documenton about youtueb_oauth currently its not working can you share link here

<!-- gh-comment-id:2678224944 --> @hextor1 commented on GitHub (Feb 24, 2025): WHich before you mentioned in the old documenton about youtueb_oauth currently its not working can you share link here
Author
Owner

@hextor1 commented on GitHub (Mar 1, 2025):

@dumbmoron Please let me know which file i need to read???

<!-- gh-comment-id:2692081435 --> @hextor1 commented on GitHub (Mar 1, 2025): @dumbmoron Please let me know which file i need to read???
Sign in to join this conversation.