plugin.video.sendtokodi icon indicating copy to clipboard operation
plugin.video.sendtokodi copied to clipboard

Peertube streams are only partially loaded

Open stemy2 opened this issue 3 years ago • 3 comments

Describe the bug When i ask Sendtokodi to load a peertube stream, i have a video way shorter that it should be, because the duration detected by kodi is not the real video duration, making the video stop too early.

To Reproduce One of the videos:https://skeptikon.fr/w/jqvXupkVUVzJDwEToh85bx

Expected behavior The video is entirely extracted.

Kodi and sendtokodi version (please complete the following information):

  • Kodi: 19.4
  • Addon: 0.9.364

Provide a Kodi log IMG_20221229_232152

Screenshots

Additional context I tried with yt-dlp, and it had to retry because of the connection has been reset. It may be a good clue.

stemy2 avatar Dec 30 '22 09:12 stemy2

I did some quick tests and your site is actually a good corner case of where again ytdlp/the page is not very consistent.

Firstly, I assume in the addon settings under "adaptive" the setting "use original manifest" is turned off? I have mine usually turned on as it makes a lot of other pages (that I use) work. With the feature turned on I do not get your link working at all (see below for the explanation).

The issue is that nowadays more and more websites use fragmented streams where there is no such thing as a "one file stream". Usually multiple streams (for audio, video, multiple qualities, languages etc.) get mixed together on the end device. Interestingly the page you provided uses this technique but there are streams which contains audio and video on the same time. So those could be seen as "one file stream" while they are part of the adaptive streaming concept. With the "use original manifest" setting turned off we let ytdlp search for the best "one file stream" which in that case is one of the adaptive streams (which is not the most common case for other streaming sites) containing both audio and video. Unfortunately, the correct duration is not within this stream and usually this would not needed as this particular stream is just one stream of many and part of the adaptive streaming technique which usually relies on a "manifest". This manifest declares all meta infos (like duration, URLs on where to find the fragmented streams etc.). So kodi just guesses the wrong duration (not our or anyone's fault).

If you turn the setting on, the plugin tries to find the manifest file and actually enable adaptive streaming (where you can choose qualities, languages etc. on the fly within the regular kodi gui). Unfortunately, your provided website either hides the manifest or the ytdlp extractor of that page simply does not provide it. In that case we usually fallback to our way of trying to find the best "one file stream". It seems like we do it a bit different than ytdlp itself and simply find not suitable stream as they are in fact all part of the adpative streaming technique.

TL;DR: Building custom HLS/DASH manifests is required for this page to work correct. This is tracked here https://github.com/firsttris/plugin.video.sendtokodi/issues/34

nullket avatar Jan 02 '23 11:01 nullket

So do we have to wait until the website maintainer implement a correct manifest ?

stemy2 avatar Jan 06 '23 11:01 stemy2

Websites sometimes simply hide the manifest (on purpose or not). In that case sendtokodi must create a manifest itself based on the found streams and provide that custom manifest to kodi. This is not implemented yet and basically tracked in the issue above. The reason it is not implemented yet is that there many exceptions (different implementations for different websites) and a special way on how this manifest must be provided to kodi (via a webserver).

nullket avatar Jan 07 '23 11:01 nullket

I retried recently, the duration problem is fixed, but there's another problem: videos are played without the sound. I checked, it's not a misconfiguration in kodi and the said videos actually have sound.

stemy2 avatar Nov 02 '24 08:11 stemy2

I retried recently, the duration problem is fixed, but there's another problem: videos are played without the sound. I checked, it's not a misconfiguration in kodi and the said videos actually have sound.

I found a workaround: disable "use original manifest".

stemy2 avatar Nov 02 '24 20:11 stemy2