fixup! fix: bruteforce the way until it gets player 7795af42
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 55s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 55s
This commit is contained in:
parent
980c420d8d
commit
84e92f743d
1 changed files with 18 additions and 0 deletions
18
src/main.ts
18
src/main.ts
|
@ -3,6 +3,7 @@ import { routes } from "./routes/index.ts";
|
|||
import { Innertube, UniversalCache } from "youtubei.js";
|
||||
import { poTokenGenerate } from "./lib/jobs/potoken.ts";
|
||||
import { konfigLoader } from "./lib/helpers/konfigLoader.ts";
|
||||
import Player from "https://raw.githubusercontent.com/LuanRT/YouTube.js/refs/tags/v13.0.0-deno/deno/src/core/Player.ts";
|
||||
let getFetchClientLocation = "getFetchClient";
|
||||
if (Deno.env.get("GET_FETCH_CLIENT_LOCATION")) {
|
||||
if (Deno.env.has("DENO_COMPILED")) {
|
||||
|
@ -57,6 +58,8 @@ innertubeClient = await Innertube.create({
|
|||
cookie: innertubeClientCookies || undefined,
|
||||
});
|
||||
|
||||
const innertubePlayer = innertubeClient.session.player = new Player("7795af42", )
|
||||
|
||||
const poTokenRefreshInterval = Deno.env.get("FREQUENCY_SECONDS") ||
|
||||
konfigStore.get("jobs.youtube_session.frequency_seconds");
|
||||
console.log("[INFO] po_token refresh interval set to", poTokenRefreshInterval);
|
||||
|
@ -90,6 +93,21 @@ if (!innertubeClientOauthEnabled) {
|
|||
konfigStore,
|
||||
innertubeClientCache,
|
||||
);
|
||||
console.log(
|
||||
`[DEBUG] player_id: ${innertubeClient.session.player?.player_id}`,
|
||||
);
|
||||
while (
|
||||
innertubeClient.session.player?.player_id != "7795af42"
|
||||
) {
|
||||
innertubeClient = await poTokenGenerate(
|
||||
innertubeClient,
|
||||
konfigStore,
|
||||
innertubeClientCache as UniversalCache,
|
||||
);
|
||||
console.log(
|
||||
`[DEBUG] player_id: ${innertubeClient.session.player?.player_id}`,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
innertubeClient = await Innertube.create({
|
||||
cache: innertubeClientCache,
|
||||
|
|
Reference in a new issue