Compare commits
5 commits
c50363cd3a
...
309015454b
Author | SHA1 | Date | |
---|---|---|---|
309015454b | |||
d53d10b774 | |||
|
f89f41380a | ||
|
fd76a51933 | ||
|
f318c94bd8 |
4 changed files with 24 additions and 9 deletions
|
@ -54,11 +54,6 @@ export const youtubePlayerParsing = async (
|
||||||
|
|
||||||
const streamingData = video.streaming_data;
|
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
|
// Modify the original YouTube response to include deciphered URLs
|
||||||
if (streamingData && videoData && videoData.streamingData) {
|
if (streamingData && videoData && videoData.streamingData) {
|
||||||
const ecatcherServiceTracking = videoData.responseContext
|
const ecatcherServiceTracking = videoData.responseContext
|
||||||
|
@ -86,6 +81,11 @@ export const youtubePlayerParsing = async (
|
||||||
delete videoData.streamingData.formats[index]
|
delete videoData.streamingData.formats[index]
|
||||||
.signatureCipher;
|
.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 (
|
for (
|
||||||
const [index, adaptive_format] of streamingData
|
const [index, adaptive_format] of streamingData
|
||||||
|
@ -105,6 +105,11 @@ export const youtubePlayerParsing = async (
|
||||||
delete videoData.streamingData.adaptiveFormats[index]
|
delete videoData.streamingData.adaptiveFormats[index]
|
||||||
.signatureCipher;
|
.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',
|
help: 'TODO',
|
||||||
registers: [register]
|
registers: [register]
|
||||||
});
|
});
|
||||||
|
import health from "./health.ts";
|
||||||
|
|
||||||
export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) => {
|
export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) => {
|
||||||
app.use("*", logger());
|
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("/api/manifest/dash/id", invidiousRouteDashManifest);
|
||||||
app.route("/videoplayback", videoPlaybackProxy);
|
app.route("/videoplayback", videoPlaybackProxy);
|
||||||
app.route("/metrics", metrics)
|
app.route("/metrics", metrics)
|
||||||
|
app.route("/healthz", health);
|
||||||
};
|
};
|
||||||
|
|
|
@ -52,10 +52,6 @@ videoPlaybackProxy.get("/", async (c) => {
|
||||||
// deno-lint-ignore prefer-const
|
// deno-lint-ignore prefer-const
|
||||||
let queryParams = new URLSearchParams(urlReq.search);
|
let queryParams = new URLSearchParams(urlReq.search);
|
||||||
queryParams.delete("host");
|
queryParams.delete("host");
|
||||||
// alr parameter is only for WEB/HTML5 clients
|
|
||||||
if (client.includes("WEB")) {
|
|
||||||
queryParams.append("alr", "yes");
|
|
||||||
}
|
|
||||||
if (rangeHeader) {
|
if (rangeHeader) {
|
||||||
queryParams.append(
|
queryParams.append(
|
||||||
"range",
|
"range",
|
||||||
|
|
Loading…
Reference in a new issue