Compare commits

..

5 commits

Author SHA1 Message Date
309015454b
Merge remote-tracking branch 'upstream/master'
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m27s
2024-12-26 03:44:43 -03:00
d53d10b774
add health endpoint for healthchecks (#27) 2024-12-25 11:55:41 +00:00
Emilien Devos
f89f41380a Revert "workaround issue with TV not returning any shortDescription"
This reverts commit 6ca59654ba.
2024-12-25 10:13:37 +01:00
Emilien Devos
fd76a51933 true to yes and false to no 2024-12-24 23:19:29 +01:00
Emilien Devos
f318c94bd8 include alr=false in order to disable application redirect for now
fixes #30
2024-12-24 20:57:13 +01:00
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",