Merge remote-tracking branch 'upstream/master'
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m27s

This commit is contained in:
Fijxu 2024-12-26 03:44:43 -03:00
commit 309015454b
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
4 changed files with 24 additions and 9 deletions

View file

@ -54,11 +54,6 @@ export const youtubePlayerParsing = async (
const streamingData = video.streaming_data;
// WORKAROUND the issue with TV client not returning any short description
if (!videoData.videoDetails.shortDescription) {
videoData.videoDetails.shortDescription = "";
}
// Modify the original YouTube response to include deciphered URLs
if (streamingData && videoData && videoData.streamingData) {
const ecatcherServiceTracking = videoData.responseContext
@ -86,6 +81,11 @@ export const youtubePlayerParsing = async (
delete videoData.streamingData.formats[index]
.signatureCipher;
}
if (videoData.streamingData.formats[index].url.includes("alr=yes")) {
videoData.streamingData.formats[index].url.replace("alr=yes", "alr=no");
} else {
videoData.streamingData.formats[index].url += "&alr=no";
}
}
for (
const [index, adaptive_format] of streamingData
@ -105,6 +105,11 @@ export const youtubePlayerParsing = async (
delete videoData.streamingData.adaptiveFormats[index]
.signatureCipher;
}
if (videoData.streamingData.adaptiveFormats[index].url.includes("alr=yes")) {
videoData.streamingData.adaptiveFormats[index].url.replace("alr=yes", "alr=no");
} else {
videoData.streamingData.adaptiveFormats[index].url += "&alr=no";
}
}
}
}

12
src/routes/health.ts Normal file
View file

@ -0,0 +1,12 @@
import { Hono } from "hono";
const health = new Hono();
health.get("/", () => {
return new Response("OK", {
status: 200,
headers: { "Content-Type": "text/plain" },
});
});
export default health;

View file

@ -54,6 +54,7 @@ export const videoRestricted = new Counter({
help: 'TODO',
registers: [register]
});
import health from "./health.ts";
export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) => {
app.use("*", logger());
@ -70,4 +71,5 @@ export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) =
app.route("/api/manifest/dash/id", invidiousRouteDashManifest);
app.route("/videoplayback", videoPlaybackProxy);
app.route("/metrics", metrics)
app.route("/healthz", health);
};

View file

@ -52,10 +52,6 @@ videoPlaybackProxy.get("/", async (c) => {
// deno-lint-ignore prefer-const
let queryParams = new URLSearchParams(urlReq.search);
queryParams.delete("host");
// alr parameter is only for WEB/HTML5 clients
if (client.includes("WEB")) {
queryParams.append("alr", "yes");
}
if (rangeHeader) {
queryParams.append(
"range",