local API: Support Post Live DVR videos #3872
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
local API: Support Post Live DVR videos
Pull Request Type
Related issue
closes #3582
Description
Just after a live stream has ended, before it has been processed into a normal video, it is still in the live stream format of self intialising DASH segments. YouTube uses self-initialising segments for their live stream DASH, which is in the DASH spec but highly discouraged by the interoperability guidelines, so video.js doesn't support them. That's why we can't use DASH for the live streams but also means we can't use it for videos in the Post Live DVR state, instead we can treat them like currently live streams and use the provided HLS manifest.
This pull request only adds support for the local API, as Invidious doesn't tell us when a video has the
isPostLiveDvr
flag set.Testing
As you might be testing this days or weeks later, any Post Live DVR videos I would link to, would have been processed into normal videos by then. Instead I made a script that will find a video in the Post Live DVR state for you, so you can test this pull request, without having to find one yourself.
.mjs
node find-post-live-dvr.mjs
Try watching the video with the local API, you should be able watch and seek around, compared to previously where it would either load endlessly or show a player UI that is ended but doesn't allow you to seek back so you could watch anything.