Skip to content

[Bug] No captions are displayed when use_innertube_for_captions is enabled #5387

Description

@fieryhenry

Describe the bug

When use_innertube_for_captions is enabled in the configuration, no captions are displayed on the website or returned by the /api/v1/captions/ API endpoint.

Steps to Reproduce

  1. Go to any video e.g V-a9VDIbZCU
  2. Click on captions and select any option e.g english
  3. Resume the video, no captions are displayed.

No captions are returned by the API either - /api/v1/captions/V-a9VDIbZCU?label=English returns a 200 OK but it's just a blank page (trying to fetch a non-existent caption label gives a 404)

If I disable the use_innertube_for_captions option the API returns this:

We're sorry...</h1><p>... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now

Which is a bit weird since I'm the only person using the instance, but that isn't the issue.

If I try this on another instance such as https://inv.nadeko.net and go to https://inv.nadeko.net/api/v1/captions/V-a9VDIbZCU?label=English it does return captions:

WEBVTT
Kind: captions
Language: en

00:00:00.000 --> 00:00:02.166
so I'm going to tell you a little story about how

00:00:02.166 --> 00:00:06.000
you can use all the leftover
bits to make food and watch me

...

So it's probably an issue with my setup.

Is there something else I need to enable/do to get this working?

Logs

No errors in the dev console or browser page but on the server the docker logs (invidious-invidious-1) are:

Exception: Missing hash key: "snippet" (KeyError)
  from /usr/lib/crystal/core/string.cr:5672 in 'interpolation'
  from src/invidious/videos/transcript.cr:90:16 in 'from_raw'
  from src/invidious/routes/api/v1/videos.cr:95:20 in 'captions'
  from lib/kemal/src/kemal/route.cr:13:9 in '->'
  from lib/kemal/src/kemal/config.cr:92:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:32:7 in 'call_next'
  from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:32:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:95:12 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:32:7 in 'call_next'
  from /usr/lib/crystal/core/string.cr:3075:20 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/handler.cr:30:7 in 'call'
  from /usr/lib/crystal/core/http/server/request_processor.cr:51:11 in 'handle_client'
  from /usr/lib/crystal/core/fiber.cr:143:11 in 'run'
  from ???

2025-07-17 14:36:15 UTC [info] 200 GET /api/v1/captions/V-a9VDIbZCU?label=English 3540.31ms

There are no error logs for invidious-inv_sig_helper-1 or invidious-invidious-db-1

Additional context

Self hosted instance running the latest arm64 docker image running behind nginx on a Raspberry Pi running Debian Trixie.

Docker compose configuration:

I have redacted some parts (see REMOVED), idk if needed to though.

version: "3"
services:

  invidious:
    # image: quay.io/invidious/invidious:latest
    image: quay.io/invidious/invidious:latest-arm64 # ARM64/AArch64 devices
    restart: unless-stopped
    ports:
      - "127.0.0.1:3000:3000"
    environment:
      # Please read the following file for a comprehensive list of all available
      # configuration options and their associated syntax:
      # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: kemal
          host: invidious-db
          port: 5432
        check_tables: true
        signature_server: inv_sig_helper:12999
        visitor_data: "REMOVED"
        po_token: "REMOVED"
        external_port: 8080
        domain: inv.fyhenry.uk
        https_only: true
        statistics_enabled: false
        hmac_key: "REMOVED"
        admins: ["henry"]
        save_player_pos: true
        quality: dash
        popular_enabled: false
        feed_menu: ["Subscriptions", "Trending", "Playlists"]
        default_home: Subsriptions
        disable_proxy: false
        use_innertube_for_captions: true

    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    logging:
      options:
        max-size: "1G"
        max-file: "4"
    depends_on:
      - invidious-db

  inv_sig_helper:
    image: quay.io/invidious/inv-sig-helper:latest
    init: true
    command: ["--tcp", "0.0.0.0:12999"]
    environment:
      - RUST_LOG=info
    restart: unless-stopped
    cap_drop:
      - ALL
    read_only: true
    security_opt:
      - no-new-privileges:true

  invidious-db:
    image: docker.io/library/postgres:14
    restart: unless-stopped
    volumes:
      - postgresdata:/var/lib/postgresql/data
      - ./config/sql:/config/sql
      - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
    environment:
      POSTGRES_DB: invidious
      POSTGRES_USER: kemal
      POSTGRES_PASSWORD: kemal
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
  postgresdata:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions