Skip to content

Invidious is an alternative front-end to YouTube

Prevent player microformat from being overwritten by the next microformat (#5453)

Fijxuba02a4cdf5f2
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr
index 5335aa79..6b1dedd6 100644
--- a/src/invidious/videos/parser.cr
+++ b/src/invidious/videos/parser.cr
@@ -102,6 +102,9 @@ def extract_video_info(video_id : String)
# Don't fetch the next endpoint if the video is unavailable.
if {"OK", "LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED"}.any?(playability_status)
next_response = YoutubeAPI.next({"videoId": video_id, "params": ""})
+ # Remove the microformat returned by the /next endpoint on some videos
+ # to prevent player_response microformat from being overwritten.
+ next_response.delete("microformat")
player_response = player_response.merge(next_response)
end