Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Video API returns empty formats/adaptiveFormats for livestreams #3057

Closed
litetex opened this issue Apr 25, 2022 · 6 comments · Fixed by #3060
Closed

[bug] Video API returns empty formats/adaptiveFormats for livestreams #3057

litetex opened this issue Apr 25, 2022 · 6 comments · Fixed by #3060
Labels
bug Something isn't working type:api

Comments

@litetex
Copy link

litetex commented Apr 25, 2022

Is your enhancement request related to a problem? Please describe.
I'm currently implementing Invidious support into NewPipe (TeamNewPipe/NewPipe#8220) and noticed that no livestreams are playable because formats and adaptiveFormats return no stream.

Describe the solution you'd like
Extract and return the streams inside formats and adaptiveFormats.

Describe alternatives you've considered
Currently you have to play livestreams using the NewPipe-native YT extraction.

Additional context

N/A

@litetex litetex added the enhancement Improvement of an existing feature label Apr 25, 2022
@litetex litetex changed the title [Enhancement] API: Return formatsand adaptiveFormats for /api/v1/videos/:id for livestreams [Enhancement] API /api/v1/videos/:id - Return formats and adaptiveFormats for livestreams Apr 25, 2022
@SamantazFox SamantazFox added bug Something isn't working type:api and removed enhancement Improvement of an existing feature labels Apr 25, 2022
@SamantazFox
Copy link
Member

That's not supposed to happen xD

@SamantazFox SamantazFox changed the title [Enhancement] API /api/v1/videos/:id - Return formats and adaptiveFormats for livestreams [Enhancement] Video API returns empty formats/adaptiveFormats for livestreams Apr 25, 2022
@SamantazFox SamantazFox changed the title [Enhancement] Video API returns empty formats/adaptiveFormats for livestreams [bug] Video API returns empty formats/adaptiveFormats for livestreams Apr 25, 2022
@unixfox
Copy link
Member

unixfox commented Apr 25, 2022

Invidious use HLS and not dash for livestreams, so you have to use the hlsUrl.
I wouldn't really consider that a bug because IIRC youtube use HLS for livestream too.

@SamantazFox
Copy link
Member

@SamantazFox
Copy link
Member

@litetex I've made a quick fix, available on our test instance: https://test.invidious.io/api/v1/videos/oXQoDlOpr_M

I've also added a few other things, like audio properties (as @TiA4f8R asked on Matrix), color infos and support for MP4 Timed Text tracks (text/mp4) that are available on livestreams.

@litetex
Copy link
Author

litetex commented Apr 26, 2022

@SamantazFox
Looks good now:

Thank you for the quick fix.

However I found a few other problems on the test instance:

  • Livestreams have no views when searching for them and the date looks incorrect:
  • and the comments can't be extracted:
    https://test.invidious.io/api/v1/comments/K-ktrninq7A returns {"error":"Could not fetch comments"}
    org.schabi.newpipe.extractor.exceptions.ExtractionException: Could not get page https://test.invidious.io/api/v1/comments/461dBTJmpd8 [code=500,message=]

I guess I should create new issues for these problems or?

@SamantazFox
Copy link
Member

SamantazFox commented Apr 26, 2022

@SamantazFox Looks good now
Thank you for the quick fix.

Nice! I'll do a PR then :)

* Livestreams have no views when searching for them and the date looks incorrect:

No views is because we don't parse the runs under viewCountText, and we don't have a differenciation between the different kind of videos (live, short, regular) (it's kind of a mess atm :X).

As for the date, we don't handle that either... :facepalms:

* and the comments can't be extracted:
  https://test.invidious.io/api/v1/comments/K-ktrninq7A returns `{"error":"Could not fetch comments"}`
  `org.schabi.newpipe.extractor.exceptions.ExtractionException: Could not get page https://test.invidious.io/api/v1/comments/461dBTJmpd8 [code=500,message=]`

As for that part, it's weird. I don't have any issues requesting that from the API. Maybe there was an issue on Youtube's side? The error you got points to both onResponseReceivedEndpoints and continuationContents missing from the Youtube response.

Edit: Ah, I have a video that have the same issue. This is maybe related to the recent Youtube addition of "Super Thanks"? More likely due to #1092

I guess I should create new issues for these problems or?

Yep, please open a new one for the livestream start time/view count. Seem like nobody reported that before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working type:api
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants