mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-23 09:55:29 +00:00
Add captions to embedded videos
This commit is contained in:
@@ -1440,6 +1440,12 @@ get "/embed/:id" do |env|
|
||||
next templated "error"
|
||||
end
|
||||
|
||||
player_response = JSON.parse(video.info["player_response"])
|
||||
if player_response["captions"]?
|
||||
captions = player_response["captions"]["playerCaptionsTracklistRenderer"]["captionTracks"]?.try &.as_a
|
||||
end
|
||||
captions ||= [] of JSON::Any
|
||||
|
||||
if video.info["hlsvp"]?
|
||||
hlsvp = video.info["hlsvp"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user