Merge remote-tracking branch 'upstream/master'
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m27s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m27s
This commit is contained in:
commit
309015454b
4 changed files with 24 additions and 9 deletions
|
@ -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
12
src/routes/health.ts
Normal 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;
|
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue