mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-14 00:28:31 +00:00
YoutubeAPI: Add thirdParty/embedUrl to client context
This commit is contained in:
parent
2dc141de64
commit
9f616a53b0
@ -156,14 +156,27 @@ module YoutubeAPI
|
||||
"gl" => client_config.region || "US", # Can't be empty!
|
||||
"clientName" => client_config.name,
|
||||
"clientVersion" => client_config.version,
|
||||
"thirdParty" => {
|
||||
"embedUrl" => "", # Placeholder
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
# Add some more context if it exists in the client definitions
|
||||
if client_config.screen != ""
|
||||
if !client_config.screen.empty?
|
||||
client_context["client"]["clientScreen"] = client_config.screen
|
||||
end
|
||||
|
||||
# Replacing/removing the placeholder is easier than trying to
|
||||
# merge two different Hash structures.
|
||||
if client_config.screen == "EMBED"
|
||||
client_context["client"]["thirdParty"] = {
|
||||
"embedUrl" => "https://www.youtube.com/embed/dQw4w9WgXcQ",
|
||||
}
|
||||
else
|
||||
client_context["client"].delete("thirdParty")
|
||||
end
|
||||
|
||||
return client_context
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user