Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube Token Works Independently but Fails After Configuring in Docker (error.api.youtube.login) #898

Closed
wenguan0927 opened this issue Nov 8, 2024 · 4 comments

Comments

@wenguan0927
Copy link

problem description

I have successfully verified that the YouTube token parameters work independently and can retrieve YouTube Channel data without any issues. However, after configuring the token parameters in cookies.json and uncomment cookies.json setting in codocker-compose.yml, and restarting the Docker application, any request for YouTube video conversion returns the following error: error.api.youtube.login.

your instance configuration

docker-compose.yml config is blow

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

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

        ports:
            #- 9000:9000/tcp
            # if you use a reverse proxy (such as nginx),
            # uncomment the next line and remove the one above (9000:9000/tcp):
            - 127.0.0.1:9000:9000

        environment:
            # replace https://api.url.example/ with your instance's url
            # or else tunneling functionality won't work properly
            API_URL: "https://xxxxxxx.com/"
            # if you want to use cookies for fetching data from services,
            # uncomment the next line & volumes section
            COOKIE_PATH: "/cookies.json"

            # it's recommended to configure bot protection or api keys if the instance is public,
            # see /docs/protect-an-instance.md for more info

            # see /docs/run-an-instance.md for more variables that you can use here

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

        # uncomment only if you use the COOKIE_PATH variable
        volumes:
            - ./cookies.json:/cookies.json

    # watchtower updates the cobalt image automatically
    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
@dumbmoron
Copy link
Member

are you sure cookies.json are in the right location? (they should be in the same folder as where you run docker compose up -d)

also, have you followed the "how to configure an instance for youtube" tutorial?

@wenguan0927
Copy link
Author

are you sure cookies.json are in the right location? (they should be in the same folder as where you run docker compose up -d)

also, have you followed the "how to configure an instance for youtube" tutorial?

Yes, I put the 'cookies.json' in the same folder of docker-compose.yml, and restart docker instance, I test two different cookies.json token format of blow , but got the error 'error.api.fetch.critical'. The token works when I use it to request Youtube channel infomation by node.js script.
{
"youtube_oauth": [
"access_token=xxxxxxxxxxxxxxxx; refresh_token=xxxxxxxxxxxxxxxxxxx; scope=https://www.googleapis.com/auth/youtube.readonly; token_type=Bearer; expiry_date=1731170213480"
]
}

{
"youtube_oauth": [
"{"access_token":"xxxxxxxxxxxxxxxxxxxxx","scope":"https://www.googleapis.com/auth/youtube.readonly","token_type":"Bearer","expiry_date":1731168717606,"refresh_token":"xxxxxxxxxxxxxxxxxxx"}"
]
}

@wukko
Copy link
Member

wukko commented Nov 10, 2024

does cobalt print a message in docker logs that cookies are loaded?

@wenguan0927
Copy link
Author

Problem is solved! first I follow the "how to configure an instance for youtube" tutorial, but got timeout exception even if I use VPN to visit internet of USA, then I use another way by search in google to generate token, but it's not works. finally I seek help of a friend in USA to generate token follow the tutorial, after got the token and replace, it's works! If follow "how to configure an instance for youtube" tutorial step 4, it can be time out in China region even if you use VPN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants