mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-29 19:11:23 +00:00
Feat: Add resolution limit
This commit is contained in:
@@ -55,6 +55,14 @@ module Invidious::Routes::API::Manifest
|
||||
audio_streams = video.audio_streams.sort_by { |stream| {stream["bitrate"].as_i} }.reverse!
|
||||
video_streams = video.video_streams.sort_by { |stream| {stream["width"].as_i, stream["fps"].as_i} }.reverse!
|
||||
|
||||
# Removes all the resolutions with a height higher than CONFIG.max_dash_resolution
|
||||
if CONFIG.max_dash_resolution
|
||||
video_streams.reject! do |z|
|
||||
(z["height"].as_i > CONFIG.max_dash_resolution.not_nil!) if z["height"]?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
manifest = XML.build(indent: " ", encoding: "UTF-8") do |xml|
|
||||
xml.element("MPD", "xmlns": "urn:mpeg:dash:schema:mpd:2011",
|
||||
"profiles": "urn:mpeg:dash:profile:full:2011", minBufferTime: "PT1.5S", type: "static",
|
||||
|
||||
Reference in New Issue
Block a user