Invidious is an alternative front-end to YouTube
Fix 'unique_res' to keep resolutions unique within a representation
Omar Rothfda619f704a4
diff --git a/src/invidious.cr b/src/invidious.crindex b1ec2705..c60e5537 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -4693,7 +4693,7 @@ get "/api/manifest/dash/id/:id" do |env|region = env.params.query["region"]?# 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 representationunique_res = env.params.query["unique_res"]? && (env.params.query["unique_res"] == "true" || env.params.query["unique_res"] == "1")client = make_client(YT_URL)@@ -4767,8 +4767,8 @@ get "/api/manifest/dash/id/:id" do |env|i += 1end- heights = [] of Int32{"video/mp4", "video/webm"}.each do |mime_type|+ heights = [] of Int32xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, scanType: "progressive") dovideo_streams.select { |stream| stream["type"].starts_with? mime_type }.each do |fmt|codecs = fmt["type"].split("codecs=")[1].strip('"')