Skip to content

Commit

Permalink
allow to dynamically load external files for youtubeplayerreq + fetch…
Browse files Browse the repository at this point in the history
…client
  • Loading branch information
unixfox committed Nov 17, 2024
1 parent fe96551 commit 7ed48ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/helpers/youtubePlayerHandling.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Innertube, YT, ApiResponse } from "youtubei.js";
import { generateRandomString } from "youtubei.js/Utils";
import { compress, decompress } from "https://deno.land/x/[email protected]/mod.ts";
import { youtubePlayerReq } from "youtubePlayerReq";
const { youtubePlayerReq } = await import(Deno.env.get("YT_PLAYER_REQ_LOCATION") || "./youtubePlayerReq.ts");
import { Store } from "@willsoto/node-konfig-core";

const kv = await Deno.openKv();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/jobs/potoken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { BgConfig } from "bgutils";
import { JSDOM } from "jsdom";
import { Innertube, UniversalCache } from "youtubei.js";
import { Store } from "@willsoto/node-konfig-core";
import { getFetchClient } from "../helpers/getFetchClient.ts";
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "../helpers/getFetchClient.ts");

// Adapted from https://github.com/LuanRT/BgUtils/blob/main/examples/node/index.ts
export const poTokenGenerate = async (
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +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 { getFetchClient } from "./lib/helpers/getFetchClient.ts";
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "./lib/helpers/getFetchClient.ts");

const app = new Hono();
const konfigStore = await konfigLoader();
Expand Down
2 changes: 1 addition & 1 deletion src/routes/videoPlaybackProxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Hono } from "hono";
import { Store } from "@willsoto/node-konfig-core";
import { getFetchClient } from "../lib/helpers/getFetchClient.ts";
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "../lib/helpers/getFetchClient.ts");
import { HTTPException } from "hono/http-exception";

const videoPlaybackProxy = new Hono();
Expand Down

0 comments on commit 7ed48ad

Please sign in to comment.