mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-29 11:01:24 +00:00
Videos: Add support for OpenGraph videos
To support OpenGraph clients like Discord and other platforms able to pull the video from the OpenGraph metadata.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user