mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Fix 'unique_res' to keep resolutions unique within a representation
This commit is contained in:
parent
e4a0669da8
commit
fda619f704
1 changed files with 2 additions and 2 deletions
|
@ -4693,7 +4693,7 @@ get "/api/manifest/dash/id/:id" do |env|
|
||||||
region = env.params.query["region"]?
|
region = env.params.query["region"]?
|
||||||
|
|
||||||
# Since some implementations create playlists based on resolution regardless of different codecs,
|
# Since some implementations create playlists based on resolution regardless of different codecs,
|
||||||
# we can opt to only add a source to a representation if it has a unique height
|
# we can opt to only add a source to a representation if it has a unique height within that representation
|
||||||
unique_res = env.params.query["unique_res"]? && (env.params.query["unique_res"] == "true" || env.params.query["unique_res"] == "1")
|
unique_res = env.params.query["unique_res"]? && (env.params.query["unique_res"] == "true" || env.params.query["unique_res"] == "1")
|
||||||
|
|
||||||
client = make_client(YT_URL)
|
client = make_client(YT_URL)
|
||||||
|
@ -4767,8 +4767,8 @@ get "/api/manifest/dash/id/:id" do |env|
|
||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
heights = [] of Int32
|
|
||||||
{"video/mp4", "video/webm"}.each do |mime_type|
|
{"video/mp4", "video/webm"}.each do |mime_type|
|
||||||
|
heights = [] of Int32
|
||||||
xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, scanType: "progressive") do
|
xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, scanType: "progressive") do
|
||||||
video_streams.select { |stream| stream["type"].starts_with? mime_type }.each do |fmt|
|
video_streams.select { |stream| stream["type"].starts_with? mime_type }.each do |fmt|
|
||||||
codecs = fmt["type"].split("codecs=")[1].strip('"')
|
codecs = fmt["type"].split("codecs=")[1].strip('"')
|
||||||
|
|
Loading…
Reference in a new issue