lekma / plugin.video.invidious

Invidious Addon for Kodi
GNU General Public License v3.0
50 stars 7 forks source link

Problems with self-hosted Invidious instance #95

Closed bjoern-vh closed 1 year ago

bjoern-vh commented 1 year ago

Hello,

when my own Invidious instance stopped working at some point recently, I switched to public instances. Unfortunately, I had to switch the public instances more and more often, because there were always hangs and crashes and even forced restarts. So yesterday I sat down and set up a new instance on my server with the help of Docker and Traefik. Everything went completely smoothly and runs great in the browser.

Unfortunately, however, playing videos and displaying video thumbnails does not work in this Invidious plugin. Search and feed shows results without problems.

My current configuration:

Log when trying to play a video: ` 2023-06-30 11:49:19.464 T:891 info : [plugin.video.invidious] instance: 'https://inv.***.tld/api/v1/' 2023-06-30 11:49:19.468 T:891 info : [plugin.video.invidious] timeout: (9.05, 10.0) 2023-06-30 11:49:19.474 T:891 info : [plugin.video.invidious] {'vp9': True, 'av01': True} 2023-06-30 11:49:34.760 T:891 info : [plugin.video.invidious] request: https://inv.***.tld/api/v1/search?page=1&q=obituary&sort_by=relevance&type=video&region=DE 2023-06-30 11:49:38.041 T:2710 error : CCurlFile::Stat - http://inv.***.tld:3000/vi/H-4r3ZjRhts/hqdefault.jpg Failed: Couldn't connect to server(7) 2023-06-30 11:49:58.080 T:891 info : [plugin.video.invidious] request: https://inv.***.tld/api/v1/videos/H-4r3ZjRhts 2023-06-30 11:50:00.447 T:1158 info : [plugin.video.invidious] video: http://inv.***.tld:3000/api/manifest/dash/id/H-4r3ZjRhts?local=true 2023-06-30 11:50:00.582 T:859 info : VideoPlayer::OpenFile: plugin://plugin.video.invidious/?action=video&videoId=H-4r3ZjRhts 2023-06-30 11:50:00.583 T:2721 info : Creating InputStream 2023-06-30 11:50:00.586 T:2721 info : AddOnLog: inputstream.adaptive: [Repr. chooser] Resolution set: 1920x1080, max allowed: 1920x1080, Adjust refresh rate: 0 2023-06-30 11:50:00.632 T:2721 error : CCurlFile::CReadState::FillBuffer - (0x5d12738) Failed: Couldn't connect to server(7) 2023-06-30 11:50:00.632 T:2721 error : CCurlFile::Open - http://inv.***.tld:3000/api/manifest/dash/id/H-4r3ZjRhts?local=true Failed with code 0:

2023-06-30 11:50:00.632 T:2721 error : AddOnLog: inputstream.adaptive: CURLOpen returned an error, download failed: http://inv.***.tld:3000/api/manifest/dash/id/H-4r3ZjRhts?local=true 2023-06-30 11:50:00.632 T:2721 error : AddOnLog: inputstream.adaptive: Could not open / parse manifest (http://inv.***.tld:3000/api/manifest/dash/id/H-4r3ZjRhts?local=true) 2023-06-30 11:50:00.632 T:2721 error : CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.invidious/?action=video&videoId=H-4r3ZjRhts] 2023-06-30 11:50:00.632 T:2721 info : CVideoPlayer::OnExit() 2023-06-30 11:50:00.633 T:2721 info : ADDON: Dll Destroyed - InputStream Adaptive 2023-06-30 11:50:00.642 T:2710 info : Deleting settings information for files plugin://plugin.video.invidious/?action=video&videoId=H-4r3ZjRhts 2023-06-30 11:50:00.671 T:981 error : EXCEPTION: Kodi is not playing any file 2023-06-30 11:50:00.719 T:859 info : Skipped 1 duplicate messages.. 2023-06-30 11:50:00.719 T:859 info : CVideoPlayer::CloseFile() 2023-06-30 11:50:00.720 T:859 info : VideoPlayer: waiting for threads to exit 2023-06-30 11:50:00.720 T:859 info : VideoPlayer: finished waiting 2023-06-30 11:50:03.787 T:981 error : EXCEPTION: Kodi is not playing any file My settings.xml:

inv.***.tld api/v1 true true 10 0 de Deutsch DE Germany, Deutschland true false false false false true true true false true

`

What immediately caught my eye is that port 3000 is appended to some URLs. This cannot work. It must be: https://inv.***.tld only. If I call the URLs without port specification via curl -I, I get a positive result. In addition, sometimes http is called and other times https. I don't know how far this can cause problems.

Can you reproduce this behaviour? Am I doing something wrong?

I have tested it with my existing Kodi and on a freshly installed Kodi and have these problems with both.

I would be very happy to hear from you. If more information is needed, I will be happy to provide it.

Many thanks in advance :-)

Kind regards Björn

bjoern-vh commented 1 year ago

I just see my settings.xml has been completely destroyed. Here again as an attachment. I have to change the file extension. settings.xml.txt

lekma commented 1 year ago

it seems to me the urls with port specification are returned by your invidious instance. you should check your invidious settings.

bjoern-vh commented 1 year ago

Are you sure? I have just tested with Freetube and that works like a charm. Playing smoothly and all thumbnails are shown...

Can I do something to help? The results of curl calls or something?

lekma commented 1 year ago

try to go to that url: https://inv.***.tld/api/v1/search?page=1&q=obituary&sort_by=relevance&type=video&region=DE in a browser from the same computer as the kodi one and compare the output to: https://invidious.snopyta.org/api/v1/search?page=1&q=obituary&sort_by=relevance&type=video&region=DE that might give you a clue.

afaict the first url after that one, that shows a port is a thumbnail url, we just use the invidious provided urls for those (iirc).

could it be network connectivity problems (dns, ...)?

bjoern-vh commented 1 year ago

Yes, you are right. My instance gives http and port in response, the Snopyta instance works as expected.

I'm surprised on the one hand that it works like this with Freetube and on the other hand that my Invidious instance returns such nonsense. It is the top current version. Probably this problem occurs together wigh Traefik proxy only.

I have now helped myself in the following way: Internally Invidious runs on port 3000. Traefik redirects the network traffic from https://my.domain (which corresponds to port 443) to the Docker container on port 3000. I have set the environment variables "external_port: 443" and "https_only: true" in my docker-compose.yml. It now works as it should, just with port 443 as the suffix.

If I ever have the time, I'll have to do some more research ;-)

For now I am happy that my problem is fixed and you don't have to investigate further.

Thanks again for your fast reaction :-)

I wish a nice weekend...