support for video_cache on disk
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m2s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m2s
This commit is contained in:
parent
9f579c806a
commit
fa9a3ffb3e
1 changed files with 9 additions and 1 deletions
|
@ -16,7 +16,15 @@ if (Deno.env.get("YT_PLAYER_REQ_LOCATION")) {
|
|||
}
|
||||
const { youtubePlayerReq } = await import(youtubePlayerReqLocation);
|
||||
|
||||
const kv = await Deno.openKv();
|
||||
const videoCachePath = Deno.env.get("VIDEO_CACHE_PATH") as string || "/var/tmp/youtubei.js/video_cache"
|
||||
|
||||
let kv : Deno.Kv
|
||||
if ((Deno.env.get("VIDEO_CACHE_ON_DISK")?.toLowerCase() ?? false) == "true") {
|
||||
console.log("[INFO] Storing video cache on disk")
|
||||
kv = await Deno.openKv(videoCachePath);
|
||||
} else {
|
||||
kv = await Deno.openKv();
|
||||
}
|
||||
|
||||
export const youtubePlayerParsing = async (
|
||||
innertubeClient: Innertube,
|
||||
|
|
Loading…
Reference in a new issue