support for video_cache on disk
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m11s

This commit is contained in:
Fijxu 2024-12-20 20:33:42 -03:00
parent 9f579c806a
commit 0a811861e2
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -16,7 +16,15 @@ if (Deno.env.get("YT_PLAYER_REQ_LOCATION")) {
} }
const { youtubePlayerReq } = await import(youtubePlayerReqLocation); 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") as string).toLowerCase() == "true") {
console.log("[INFO] Storing video cache on disk")
kv = await Deno.openKv(videoCachePath);
} else {
kv = await Deno.openKv();
}
export const youtubePlayerParsing = async ( export const youtubePlayerParsing = async (
innertubeClient: Innertube, innertubeClient: Innertube,