From e2172b1f6818f50ee406e6afe5c66fe6fd30285a Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 13:22:06 +0600 Subject: [PATCH] Feat:Separate Temporary Download Directory and Final Output Directory anidl#1221 --- hidive.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hidive.ts b/hidive.ts index da588ca..a6e52d9 100644 --- a/hidive.ts +++ b/hidive.ts @@ -1117,10 +1117,29 @@ export default class Hidive implements ServiceClass { console.info('Subtitles downloading skipped!'); } + console.info('\x1b[32m[MDNX] All stream downloads & decryption completed.\x1b[0m'); + + let finalOutBase = './unknown'; + if (fileName) { + let targetDir = this.cfg.dir.content; + + if (options.outputDir) { + const parsedDir = parseFileName(options.outputDir, variables, options.numbers, options.override).join(path.sep); + targetDir = path.isAbsolute(parsedDir) ? parsedDir : path.join(this.cfg.dir.content, parsedDir); + + if (!fs.existsSync(targetDir)) { + fs.mkdirSync(targetDir, { recursive: true }); + } + } + + const finalNamePart = path.isAbsolute(fileName) ? path.basename(fileName) : fileName; + finalOutBase = path.join(targetDir, finalNamePart); + } + return { error: dlFailed, data: files, - fileName: fileName ? (path.isAbsolute(fileName) ? fileName : path.join(this.cfg.dir.content, fileName)) || './unknown' : './unknown' + fileName: finalOutBase }; }