From 818d60e196a37c2c3f381b9ebb6f379a34b8bf4d Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Wed, 20 Mar 2024 21:25:33 -0700 Subject: [PATCH] Verify file is file in CDM folder Make sure when reading cdm folder that a file is a file, not a folder. --- modules/widevine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/widevine.ts b/modules/widevine.ts index 8e21e07..62d9f8b 100644 --- a/modules/widevine.ts +++ b/modules/widevine.ts @@ -14,7 +14,7 @@ try { files.forEach(function(file) { file = path.join(workingDir, 'widevine', file); const stats = fs.statSync(file); - if (stats.size < 1024*8) { + if (stats.size < 1024*8 && stats.isFile()) { const fileContents = fs.readFileSync(file, {'encoding': 'utf8'}); if (fileContents.includes('-BEGIN RSA PRIVATE KEY-')) { privateKey = fs.readFileSync(file);