From 8144308aee078d2322491e9848247df7257d756b Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Wed, 27 Apr 2022 00:21:23 +0200 Subject: [PATCH] Add extra data to 'adaptiveFormats' in videos API --- src/invidious/videos.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 7e37cf12..cb860032 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -412,6 +412,15 @@ struct Video end end end + + # Audio-related data + json.field "audioQuality", fmt["audioQuality"] if fmt.has_key?("audioQuality") + json.field "audioSampleRate", fmt["audioSampleRate"].as_s.to_i if fmt.has_key?("audioSampleRate") + json.field "audioChannels", fmt["audioChannels"] if fmt.has_key?("audioChannels") + + # Extra misc stuff + json.field "colorInfo", fmt["colorInfo"] if fmt.has_key?("colorInfo") + json.field "captionTrack", fmt["captionTrack"] if fmt.has_key?("captionTrack") end end end