imputnet / cobalt

best way to save what you love
https://cobalt.tools
GNU Affero General Public License v3.0
15.5k stars 1.27k forks source link

error.api.content.video.unavailable while hosting own instance on aws #852

Open dhawansolanki opened 1 day ago

dhawansolanki commented 1 day ago

problem description

I'm encountering an error while trying to host Cobalt on my own instance. Here are the details: error.api.content.video.unavailable

POST : http://xx.xxx.xxx.xx:9000/ Body :

{
    "url": "https://www.youtube.com/xxxxxxxxx"
}

{
    "status": "error",
    "error": {
        "code": "error.api.content.video.unavailable",
        "context": {
            "service": "youtube"
        }
    }
}

Steps I Followed to host my instance:

  1. mkdir cobalt cd cobalt && nano docker-compose.yml

  2. docker-compose.yml :

    services:
    cobalt-api:
        image: ghcr.io/imputnet/cobalt:10
        restart: unless-stopped
        container_name: cobalt-api
    
        init: true
    
        ports:
            - 9000:9000/tcp
            # if you're using a reverse proxy, uncomment the next line and remove the one above (9000:9000/tcp):
            #- 127.0.0.1:9000:9000
    
        environment:
            # replace https://api.cobalt.tools/ with your instance's target url in same format
            API_URL: "http://xx.xxx.xxx.xx/"
            # if you want to use cookies when fetching data from services, uncomment the next line and the lines under volume
            COOKIE_PATH: "/cookies.json"
            # see docs/run-an-instance.md for more information
        labels:
            - com.centurylinklabs.watchtower.scope=cobalt
    
        # if you want to use cookies when fetching data from services, uncomment volumes and next line
        volumes:
            - ./cookies.json:/cookies.json
    
    # update the cobalt image automatically with watchtower
    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
  3. added cookies.json

  4. docker compose up -d

Additional Context I followed the documentation carefully but still received the error. Able to download youtube videos on local machine, but when same thing is deployed on EC2 instance, it throws the above said error.

your instance configuration

AWS EC2 t2.medium
Ubuntu 24.04.1 LTS
KwiatekMiki commented 14 hours ago

did you at least try doing what i said on #844 before making this issue?

same answer, set up cookies for youtube.

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

and also you didn't provide any example links (which can be important sometimes) so you could've tried to download a region locked video