From 1fb0a495925a60b2d4839b98440e220b7f95d10e Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 13 Jan 2023 12:05:01 -0500 Subject: [PATCH 1/2] Make DASH absolute urls when local --- src/invidious/routes/api/manifest.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr index ae65f10d..f5d8e5de 100644 --- a/src/invidious/routes/api/manifest.cr +++ b/src/invidious/routes/api/manifest.cr @@ -42,7 +42,7 @@ module Invidious::Routes::API::Manifest if local adaptive_fmts.each do |fmt| - fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).request_target) + fmt["url"] = JSON::Any.new("#{HOST_URL}#{URI.parse(fmt["url"].as_s).request_target}") end end From 910809f1eb185328fa94b5d8baff9ba7756ade48 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 16 Jan 2023 08:33:34 -0500 Subject: [PATCH 2/2] Handle case with included manifest --- src/invidious/routes/api/manifest.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr index f5d8e5de..662d1002 100644 --- a/src/invidious/routes/api/manifest.cr +++ b/src/invidious/routes/api/manifest.cr @@ -29,7 +29,7 @@ module Invidious::Routes::API::Manifest if local uri = URI.parse(url) - url = "#{uri.request_target}host/#{uri.host}/" + url = "#{HOST_URL}#{uri.request_target}host/#{uri.host}/" end "#{url}"