lamarios / clipious

Invidious client for android
GNU Affero General Public License v3.0
977 stars 33 forks source link

Can't get thumbnails or videos to play on local server #444

Open Fasterwolf opened 10 months ago

Fasterwolf commented 10 months ago

I have Invidious installed on a local server and is not going through a reverse proxy. Accessing the local address loads thumbs and video with out any issue. When I try to get them to load through Clipious I just get a ! and nothing loads. I did verify that I have set the external port and domain. I have also tried with external port being 3000 along with 80 as there is no ssl, tired domain with port and without. I have also reinstalled Clipious on each attempt to make sure i was working with a fresh install.

lamarios commented 10 months ago

Did you check the thumbnails values on the api of your server according to the wiki?

Fasterwolf commented 10 months ago

Yes I confirmed they were showing up correctly when checking the API

lamarios commented 10 months ago

Is it an old version of android?

Fasterwolf commented 10 months ago

Nope samsung s23 ultra completely up to date

lamarios commented 10 months ago

To be honest I'm not sure what is the issue. I never faced any issues with my own instance so I can't help based on experience.

If the app works with public servers then I doubt that's an issue with the app itself.

It's strange because if you don't use the local proxy option then the video urls are straight form Google so I'm not sure what's the blocker here.

zer0factor commented 10 months ago

Having the same issue here. The only config is the "thin mode"? That didn't help.

zer0factor commented 10 months ago

Nevermind fix with total rebuild.(With domain/external port) Clear cache on the app(dont know if that help.)

B0G0311 commented 9 months ago

@zer0factor before you solved the problem by adding a domain. Did the ip/port combo have https or http? Now is it https? I have ran into the same issue running invidious on an umbrel. I think it may be due to tls or lack there of one.

zer0factor commented 9 months ago

yes, you need a valid TLS cert. The "Skip SSL" option in the app doesnt seem to work with Dash player.

lagset commented 9 months ago

I've got the same problem as the original post, but am hosting invidious behind a reversre proxy in local Lan with an own certificate which is signed by my own root ca (and installed in the android os certificate store of the client device). The certificate is served by the reverse proxy.

The options external_port, domain and https_only are set in invidious,m and it seems to work correctly since thumbnails are displayed in clipious.

Some random public instance works with Dash in clipious (even with "skip SSL" enabled). My private instance does not work with Dash in clipious (same symptoms as OP) but on the invidious web interface Dash works.

That's the app log, when I select a video in clipious and then the exclamation icon appears in the player:

[INFO] [Service] - 2024-02-22 00:13:15.484992 - calling https://xxxxxxxxxx/api/v1/videos/ov_7HT8bbX4 
[INFO] [Service] - 2024-02-22 00:13:16.024292 - calling https://xxxxxxxxxx/api/v1/auth/playlists 
[INFO] [Service] - 2024-02-22 00:13:16.025004 - calling https://xxxxxxxxxx/api/v1/auth/subscriptions 
[INFO] [VideoPlayer] - 2024-02-22 00:13:16.043486 - Playing url (dash true,  hasHls ? false)  https://my.private.domain/api/manifest/dash/id/ov_7HT8bbX4 
[INFO] [Service] - 2024-02-22 00:13:16.046111 - calling https://xxxxxxxxxx/api/v1/auth/subscriptions 
[INFO] [Service] - 2024-02-22 00:13:16.164143 - Response from GET https://xxxxxxxxxx/api/v1/auth/playlists, status: 200 
[INFO] [Service] - 2024-02-22 00:13:16.189021 - Response from GET https://xxxxxxxxxx/api/v1/auth/subscriptions, status: 200 
[INFO] [Service] - 2024-02-22 00:13:16.195226 - Response from GET https://xxxxxxxxxx/api/v1/auth/subscriptions, status: 200 
[INFO] [PlayerControlControllers] - 2024-02-22 00:13:19.056789 - Hiding controls false

The URL https://my.private.domain/api/manifest/dash/id/ov_7HT8bbX4 returns a .bin file for the video which looks valid as far as I can tell (at least not different to the files served by public instances).

If anyone knows a solution or a promising approach, let me know!

jhlee2222 commented 8 months ago

I have a variation of this issue. Though videos play just fine from Clipious, thumbnails are as others describe, with a !. I am accessing a local instance of Invidious on a server in my home. Using the web UI on various machines, Invidious appears fine. I'm a bit unsure of how to alter the config. I set Invidious up using docker compose. Below is my Docker Compose yml:

version: "3"
services:

  invidious:
    image: quay.io/invidious/invidious:latest
    # image: quay.io/invidious/invidious:latest-arm64 # ARM64/AArch64 devices
    restart: unless-stopped
    ports:
      - "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:
        # domain:
        # https_only: false
        # statistics_enabled: false
        hmac_key: "don'twanttolistitinapost"
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    logging:
      options:
        max-size: "1G"
        max-file: "4"
    depends_on:
      - invidious-db

  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:

I know this is honestly troubleshooting my Invidious setup. However, I suspect many of your users are going to be using the same template to set up their own instances. If anyone can advise on what to change in the above so config is set properly to resolve the issue with thumbnails, I would greatly appreciate the help.

lamarios commented 8 months ago

For the thumbnails to work the api needs to return the full path of it. (see wiki page about it). I believe your config is missing the external port and domain so that invidious know was to put in for the full path of the thumbnails. I believe it can be just an ip address and default port.

jhlee2222 commented 8 months ago

2024-11-06 Update to remedy later login issue: @lamarios , Thank You! I was able to isolate the config section and fix it. For anyone needing specifics, refer back to my example docker-compose.yml, and pay attention to these two lines:

        # external_port:
        # domain:

Edit them to uncomment and populate them as follows with your info:

        external_port: <Your_Host_Port>
        domain: <Your_Host_IP>

Include your external port, then for the domain, it will be in the format with no leading "http(s)//:". For example:

external_port: 3000 domain: 192.168.1.1

Your external port may vary if you're using https, but for those of us using bare-bones, local setups, it will likely be 3000. Sorry if I'm seeming to dumb it down too much, but some users like myself sort of need it spelled out like this.

lamarios commented 8 months ago

This is documented in the wiki as well :)

jhlee2222 commented 2 weeks ago

I've noticed an odd wrinkle when applying the fix to my instance(s). It seems specifying the port and domain does fix the thumbnail problem, but it makes invidious impossible to log back into once logged out. In most cases, that's not a problem. Most people hosting for themselves have one user. Once logged in, the change to add the domain and port can be made with likely no need to log back in again. I noticed with Clipious, this became a bigger problem with what I'm trying to do.

It doesn't appear Clipious allows you to swap users on the same server. As a workaround, I simply spun up another instance on another internal IP. However, it seems swapping between servers is the same as logging out. After doing so, I can log back in, but videos won't play properly on Clipious.

Is there some other detail I'm missing that's causing this "once logged out, can't log in again" problem? Reverting my docker compose to omit the port and domain allow me to log back in again, but of course break the thumbnails in Clipious. Aside from this, could some sort of user or account switching be made as a later enhancement to Clipious?

jhlee2222 commented 2 weeks ago

I resolved my issue through trial and error and have edited my older comment. I was using the wrong port and including the port in my domain, which resulted in a partially functioning invidious instance, but with the login issue I noted. After correcting it, the login issue is resolved.

As for profile switching, though I'm not able to swap users on the same server in Clipious, I was able to make a workaround by simply creating additional Invidious instances. I'll mention that profile swap as a requested enhancement.