diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-06-06 21:32:39 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-06-06 21:32:39 -0500 |
| commit | fda619f704a442970157407c8446341ccdb84977 (patch) | |
| tree | 59c329eb5b0f4f6704732a1ffc9ba05ba33d14bb /src | |
| parent | e4a0669da8cd428dc577f91f915644298f97667e (diff) | |
| download | invidious-fda619f704a442970157407c8446341ccdb84977.tar.gz invidious-fda619f704a442970157407c8446341ccdb84977.tar.bz2 invidious-fda619f704a442970157407c8446341ccdb84977.zip | |
Fix 'unique_res' to keep resolutions unique within a representation
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 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 representation unique_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 += 1 end - heights = [] of Int32 {"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 video_streams.select { |stream| stream["type"].starts_with? mime_type }.each do |fmt| codecs = fmt["type"].split("codecs=")[1].strip('"') |
