fixup! add support for an external videoplayback proxy
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m7s

This commit is contained in:
Fijxu 2025-02-28 18:20:02 -03:00
parent 9512877ff2
commit 34c9df22e7
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 12 additions and 6 deletions

View file

@ -95,9 +95,12 @@ dashManifest.get("/:videoId", async (c) => {
let dashUrl = url;
if (local) {
// Can't create URL type without host part
dashUrl = (konfigStore.get(
"networking.external_videoplayback_proxy",
) as string ?? "") +
dashUrl = (
Deno.env.get("EXTERNAL_VIDEOPLAYBACK_PROXY") ||
(konfigStore.get(
"networking.external_videoplayback_proxy",
) as string ?? "")
) +
(dashUrl.pathname + dashUrl.search + "&host=" +
dashUrl.host) as unknown as URL;
if (konfigStore.get("networking.ump") as boolean) {

View file

@ -63,9 +63,12 @@ latestVersion.get("/", async (c) => {
const itagUrlParsed = new URL(itagUrl);
let urlToRedirect = itagUrlParsed.toString();
if (local) {
urlToRedirect = (konfigStore.get(
"networking.external_videoplayback_proxy",
) as string ?? "") +
urlToRedirect = (
Deno.env.get("EXTERNAL_VIDEOPLAYBACK_PROXY") ||
(konfigStore.get(
"networking.external_videoplayback_proxy",
) as string ?? "")
) +
itagUrlParsed.pathname + itagUrlParsed.search +
"&host=" + itagUrlParsed.host;
}