iv-org / invidious

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

Fix parsing live_now and premiere_timestamp #4934

Open absidue opened 1 week ago

absidue commented 1 week 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."}