[YouTube] Fix videos without next stream throwing error and add test for unlisted videos #288
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.
(from discussion on IRC) In my opinion getNextStream should be removed from the extractor and the next video should be just prepended, when available, to the suggested videos. The app would then consider the first stream of the suggested videos as the next one. This imo would solve many issues, such as those complaining some videos have no next stream, and remove unneded complexity from the extractor.
But for now I went with the
return null
option, which is consistent with what other services do.I also added a test for unlisted videos (apart from the "next video" function there should be no differences, but having one more test never hurt anyone ;-) )
Fixes TeamNewPipe/NewPipe#3226
Closes TeamNewPipe/NewPipe#2658