diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2024-04-26 23:49:44 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2024-04-26 23:49:44 +0200 |
| commit | 8eaaeb1c74c74f32d872ec73b35ee21bb14f7c3b (patch) | |
| tree | 1a67ea9cc77455825d1886acc1c494726db708fe /src | |
| parent | 7c1d2714e00ae737b895313ec76bffe566aed269 (diff) | |
| parent | f313162fa1080bc4797dbf11ee44f51cc4c57985 (diff) | |
| download | invidious-8eaaeb1c74c74f32d872ec73b35ee21bb14f7c3b.tar.gz invidious-8eaaeb1c74c74f32d872ec73b35ee21bb14f7c3b.tar.bz2 invidious-8eaaeb1c74c74f32d872ec73b35ee21bb14f7c3b.zip | |
API: Add bitrate to formatStreams too (#4590)
Before this PR, the bitrate was only returned for the 'adaptiveFormats'.
They are now also returned the 'formatStreams'.
No linked issue
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/jsonify/api_v1/video_json.cr | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/invidious/jsonify/api_v1/video_json.cr b/src/invidious/jsonify/api_v1/video_json.cr index 4fe90289..0dced80b 100644 --- a/src/invidious/jsonify/api_v1/video_json.cr +++ b/src/invidious/jsonify/api_v1/video_json.cr @@ -161,6 +161,8 @@ module Invidious::JSONify::APIv1 json.field "type", fmt["mimeType"] json.field "quality", fmt["quality"] + json.field "bitrate", fmt["bitrate"].as_i.to_s if fmt["bitrate"]? + fmt_info = Invidious::Videos::Formats.itag_to_metadata?(fmt["itag"]) if fmt_info fps = fmt_info["fps"]?.try &.to_i || fmt["fps"]?.try &.as_i || 30 |
