diff --git a/src/lib/helpers/youtubePlayerHandling.ts b/src/lib/helpers/youtubePlayerHandling.ts index fccc268..7b09e5b 100644 --- a/src/lib/helpers/youtubePlayerHandling.ts +++ b/src/lib/helpers/youtubePlayerHandling.ts @@ -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"; + } } } } diff --git a/src/routes/health.ts b/src/routes/health.ts new file mode 100644 index 0000000..517a991 --- /dev/null +++ b/src/routes/health.ts @@ -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; \ No newline at end of file diff --git a/src/routes/index.ts b/src/routes/index.ts index bfc02d4..b8cde29 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -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>) => { app.use("*", logger()); @@ -70,4 +71,5 @@ export const routes = (app: Hono, konfigStore: Store>) = app.route("/api/manifest/dash/id", invidiousRouteDashManifest); app.route("/videoplayback", videoPlaybackProxy); app.route("/metrics", metrics) + app.route("/healthz", health); }; diff --git a/src/routes/videoPlaybackProxy.ts b/src/routes/videoPlaybackProxy.ts index 9f52a87..ab84622 100644 --- a/src/routes/videoPlaybackProxy.ts +++ b/src/routes/videoPlaybackProxy.ts @@ -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",