mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-16 01:48:51 +00:00
videos: handle different JSON structs being present in cache
This commit is contained in:
@@ -71,7 +71,8 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
|
||||
# Stop here if video is not a scheduled livestream
|
||||
if playability_status != "LIVE_STREAM_OFFLINE"
|
||||
return {
|
||||
"reason" => JSON::Any.new(reason),
|
||||
"version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64),
|
||||
"reason" => JSON::Any.new(reason),
|
||||
}
|
||||
end
|
||||
elsif video_id != player_response.dig("videoDetails", "videoId")
|
||||
@@ -121,6 +122,9 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
|
||||
params[f] = player_response[f] if player_response[f]?
|
||||
end
|
||||
|
||||
# Data structure version, for cache control
|
||||
params["version"] = JSON::Any.new(Video::SCHEMA_VERSION.to_i64)
|
||||
|
||||
return params
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user