iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.46k stars 1.85k forks source link

Parsers: Fix parsing live_now and premiere_timestamp #4934

Closed absidue closed 2 weeks ago

absidue commented 2 months ago

Related to https://github.com/iv-org/invidious/issues/4929

This pull request fixes the parsing for the live_now and premiere_timestamp variables so that they work without the microformat data being present.

Testing live_now: /api/v1/videos/jfKfPfyJRdk -> type should be "livestream" and liveNow should be true

Testing premiere_timestamp:

  1. Go to https://www.youtube.com/live and pick a video from the Upcoming Live Streams section
  2. /api/v1/videos/{videoID} => should return a HTTP 500 status code and the following json {"error":"This live event will begin in 56 minutes."}
SamantazFox commented 2 weeks ago

Thanks again for contributing :)