feat!: Add support for OTF format streams #351
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.
Description
Some videos have formats that are a bit different than other ones, YouTube seems to refer to these as OTF. According to NewPipeExtractor (https://github.com/TeamNewPipe/NewPipeExtractor/blob/dev/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/DeliveryType.java#L23-L38) these can occur on videos with low view counts and live stream replays that have just been reencoded to normal videos. Instead of allowing you to request arbitrary chunks with the
range
query parameter, instead you use thesq
query parameter to request sequences, the first sequence (&sq=0
) contains the duration of the sequences, so we need to request it while building the DASH manifest.This implementation was inspired by the NewPipeExtractor implementation, so big thanks to them :).
Here is a video with OTF streams: https://www.youtube.com/watch?v=DJ8GQUNUXGM
The 720p and 360p streams are normal, the other ones (144p, 240p and 480p) are OTF streams
The
toDash
functions are now asynchronous, they return aPromise<string>
instead of astring
, as we need to fetch the first sequence while building the manifest.Type of change
Please delete options that are not relevant.
Checklist:
for release please:
BEGIN_COMMIT_OVERRIDE
feat!: Add support for OTF format streams
BREAKING CHANGE: The
toDash
functions are now asynchronous, they now return aPromise<string>
instead of astring
, as we need to fetch the first sequence of the OTF format streams while building the manifest.END_COMMIT_OVERRIDE