Videos: Add support for OpenGraph videos
All checks were successful
Invidious CI / build (push) Successful in 5m20s
All checks were successful
Invidious CI / build (push) Successful in 5m20s
To support OpenGraph clients like Discord and other platforms able to pull the video from the OpenGraph metadata.
This commit is contained in:
parent
e3da8f408d
commit
26b3f182d8
2 changed files with 12 additions and 3 deletions
|
@ -152,6 +152,7 @@ module Invidious::Routes::Watch
|
|||
end
|
||||
end
|
||||
|
||||
# Removes non default audio tracks
|
||||
audio_streams.reject! do |z|
|
||||
z if z.dig?("audioTrack", "audioIsDefault") == false
|
||||
end
|
||||
|
@ -218,6 +219,12 @@ module Invidious::Routes::Watch
|
|||
captions: video.captions
|
||||
)
|
||||
|
||||
begin
|
||||
video_url = "https://#{URI.parse(fmt_stream[0]["url"].to_s).query_params["host"]}#{fmt_stream[0]["url"].to_s}"
|
||||
rescue
|
||||
video_url = nil
|
||||
end
|
||||
|
||||
templated "watch"
|
||||
end
|
||||
|
||||
|
|
|
@ -13,9 +13,11 @@
|
|||
<meta property="og:image" content="<%= HOST_URL %>/vi/<%= video.id %>/maxres.jpg">
|
||||
<meta property="og:description" content="<%= HTML.escape(video.short_description) %>">
|
||||
<meta property="og:type" content="video.other">
|
||||
<meta property="og:video:url" content="<%= HOST_URL %>/embed/<%= video.id %>">
|
||||
<meta property="og:video:secure_url" content="<%= HOST_URL %>/embed/<%= video.id %>">
|
||||
<meta property="og:video:type" content="text/html">
|
||||
<!-- This shouldn't be empty, ever. -->
|
||||
<meta property="og:video" content="<%= video_url %>">
|
||||
<meta property="og:video:url" content="<%= video_url %>">
|
||||
<!-- <meta property="og:video:secure_url" content="<%= HOST_URL %>/embed/<%= video.id %>"> -->
|
||||
<meta property="og:video:type" content="video/mp4">
|
||||
<meta property="og:video:width" content="1280">
|
||||
<meta property="og:video:height" content="720">
|
||||
<meta name="twitter:card" content="player">
|
||||
|
|
Loading…
Reference in a new issue