iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.42k stars 1.85k forks source link

[Question] Wrong Videoplayback ip / 403 #4854

Closed r-eu9 closed 2 months ago

r-eu9 commented 3 months ago

I use the invidious docker installation behind an apache2 reverse proxy. The VM is only via IPv6 reachable from outside. But the VM can use IPv4 for outgoing traffic via NAT. When I try to view a video it fails with 403. I assume the origin of the problem is the "ip=.." part of the /videoplayback URL. The IP is the IPv4 address of the NATing host.

The installation is with Debian 11.10 and docker 20.10.5 I use the po_token and visitor_data config entries in the docker-compose.yml:


version: "3"
services:

  invidious:
    build:
      context: .
      dockerfile: docker/Dockerfile
    restart: unless-stopped
    ports:
      - "127.0.0.1:3000:3000"
      - "::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
        external_port: 443
        domain: host.example.com
        # disable_proxy: true
        https_only: true
        # force_resolve: ipv6
        # statistics_enabled: false
        hmac_key: "******"
        registration_enabled: false
        login_enabled: false
        po_token: "*******"
        visitor_data: "******"
        # locale: de
        region: DE
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
martinetd commented 2 months ago

Had similar 403 errors, ensuring everything uses the same IP for outgoing traffic (po/vistor token obtention, inv_sig_helper and invidious) fixed it.

I don't think there's much that can be done here as it's tied to what google provides when one fetches resources..

unixfox commented 2 months ago

@r-eu9 I don't see you running inv_sig_helper.

Make sure to follow the guide here: https://github.com/iv-org/documentation/pull/581

r-eu9 commented 2 months ago

Thx. The inv_sig_helper setup fixt it.