mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add captions to embedded videos
This commit is contained in:
parent
42405a34f1
commit
a12690cbfd
3 changed files with 20 additions and 10 deletions
|
@ -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"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue