Skip to content

Commit ba02a4c

Browse files
Fijxusyeopite
andauthored
Prevent player microformat from being overwritten by the next microformat (iv-org#5453)
* Prevent player microformat from being overwritten by the next microformat Closes iv-org#5443 The player microformat is what we need to get the published date, premiere timestamp, allowed regions and more information of the video. Youtube introduced a new `microformat.microformatDataRenderer` in the next endpoint which overwrote the player microformat `microformat.playerMicroformatRenderer` when merged * Update src/invidious/videos/parser.cr Co-authored-by: syeopite <[email protected]> --------- Co-authored-by: syeopite <[email protected]>
1 parent cf2dfbb commit ba02a4c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/invidious/videos/parser.cr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def extract_video_info(video_id : String)
102102
# Don't fetch the next endpoint if the video is unavailable.
103103
if {"OK", "LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED"}.any?(playability_status)
104104
next_response = YoutubeAPI.next({"videoId": video_id, "params": ""})
105+
# Remove the microformat returned by the /next endpoint on some videos
106+
# to prevent player_response microformat from being overwritten.
107+
next_response.delete("microformat")
105108
player_response = player_response.merge(next_response)
106109
end
107110

0 commit comments

Comments
 (0)