fixing await dynamic import

This commit is contained in:
Emilien 2024-12-12 21:36:38 +01:00
parent a4519724e8
commit 45003ebabd
5 changed files with 5 additions and 4 deletions

View file

@ -17,6 +17,7 @@
"@willsoto/node-konfig-file": "npm:@willsoto/node-konfig-file@3.0.0",
"@willsoto/node-konfig-toml-parser": "npm:@willsoto/node-konfig-toml-parser@3.0.0",
"youtubePlayerReq": "./src/lib/helpers/youtubePlayerReq.ts",
"getFetchClient": "./src/lib/helpers/getFetchClient.ts",
"googlevideo": "npm:googlevideo@2.0.0"
},
"unstable": ["cron", "kv", "http"]

View file

@ -2,7 +2,7 @@ import { ApiResponse, Innertube, YT } from "youtubei.js";
import { generateRandomString } from "youtubei.js/Utils";
import { compress, decompress } from "https://deno.land/x/brotli@0.1.7/mod.ts";
const { youtubePlayerReq } = await import(
Deno.env.get("YT_PLAYER_REQ_LOCATION") || "./youtubePlayerReq.ts"
Deno.env.get("YT_PLAYER_REQ_LOCATION") || "youtubePlayerReq"
);
import { Store } from "@willsoto/node-konfig-core";

View file

@ -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";
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "../helpers/getFetchClient.ts");
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "getFetchClient");
// Adapted from https://github.com/LuanRT/BgUtils/blob/main/examples/node/index.ts
export const poTokenGenerate = async (

View file

@ -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";
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "./lib/helpers/getFetchClient.ts");
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "getFetchClient");
const app = new Hono();
const konfigStore = await konfigLoader();

View file

@ -1,6 +1,6 @@
import { Hono } from "hono";
import { Store } from "@willsoto/node-konfig-core";
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "../lib/helpers/getFetchClient.ts");
const { getFetchClient } = await import(Deno.env.get("GET_FETCH_CLIENT_LOCATION") || "getFetchClient");
import { HTTPException } from "hono/http-exception";
const videoPlaybackProxy = new Hono();