From 4ff0157f65cb8187a8ba9f906cf38ed2ef1065fe Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 12:59:09 +0600 Subject: [PATCH 1/8] Feat:Separate Temporary Download Directory and Final Output Directory #1221 --- modules/module.args.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/module.args.ts b/modules/module.args.ts index f8bc37c..e0e0ec3 100644 --- a/modules/module.args.ts +++ b/modules/module.args.ts @@ -666,6 +666,18 @@ const args: TAppArg[] = [ default: '[${service}] ${showTitle} - S${season}E${episode} [${height}p]' } }, + { + name: 'outputDir', + group: 'fileName', + describe: 'Set a custom directory for the final muxed file (supports template variables). Temporary files remain in the default content folder.', + docDescribe: true, + service: ['all'], + type: 'string', + usage: '${outputDir}', + default: { + default: '' + } + }, { name: 'numbers', group: 'fileName', From 21fad8ed6657f644dd6a240912a975d08f582018 Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 13:17:53 +0600 Subject: [PATCH 2/8] Feat:Separate Temporary Download Directory and Final Output Directory anidl#1221 --- adn.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/adn.ts b/adn.ts index fe3e2a3..d2afbf3 100644 --- a/adn.ts +++ b/adn.ts @@ -959,10 +959,29 @@ export default class AnimationDigitalNetwork 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 }; } From 67ad1bc3893098faebb8219a2fe08f68462e8493 Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 13:19:14 +0600 Subject: [PATCH 3/8] Update print statement from 'Hello' to 'GoodbyeFeat:Separate Temporary Download Directory and Final Output Directory anidl#1221' --- crunchy.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/crunchy.ts b/crunchy.ts index df35438..6a3cf9d 100644 --- a/crunchy.ts +++ b/crunchy.ts @@ -3032,10 +3032,29 @@ export default class Crunchy implements ServiceClass { await this.sleep(options.waittime); } + 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 }; } From e2172b1f6818f50ee406e6afe5c66fe6fd30285a Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 13:22:06 +0600 Subject: [PATCH 4/8] 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 }; } From 994d352aea8b29431e61d6ffee5cbb87c26c89a7 Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 13:53:09 +0600 Subject: [PATCH 5/8] added documentation for output directory settings Expanded documentation for output directory configuration, including variable usage and examples. --- docs/DOCUMENTATION.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/DOCUMENTATION.md b/docs/DOCUMENTATION.md index 35ee4df..1defd20 100644 --- a/docs/DOCUMENTATION.md +++ b/docs/DOCUMENTATION.md @@ -472,6 +472,18 @@ Possible Values: und, eng, eng, spa, spa-419, spa-ES, por, por, fra, deu, ara-ME Set the filename template. Use ${variable_name} to insert variables. You can also create folders by inserting a path seperator in the filename You may use 'title', 'episode', 'showTitle', 'seriesTitle', 'season', 'width', 'height', 'service' as variables. + +### Output Directory +#### `--outputDir` +| **Service** | **Usage** | **Type** | **Required** | **Alias** | **Default** | **cli-default Entry** | +| --- | --- | --- | --- | --- | --- | --- | +| All | `--outputDir ${outputDir}` | `string` | `No` | `NaN` | Final output is written to the default content directory when not set | `outputDir: ` | + + +Sets the output directory for the final muxed file. Use `${variable_name}` to insert variables. +You can also create subfolders by including path separators in the directory path. You may use `title`, `episode`, `showTitle`, `seriesTitle`, `season`, `width`, `height`, and `service` as variables. +example `--outputDir '/home/Anime/${seriesTitle}/S${season}/'` + #### `--numbers` | **Service** | **Usage** | **Type** | **Required** | **Alias** | **Default** |**cli-default Entry** | --- | --- | --- | --- | --- | --- | ---| From 879ea052cb3f23dc6ad6c8c2a2e73ca0a1fccda4 Mon Sep 17 00:00:00 2001 From: Nabil Khan Date: Wed, 25 Mar 2026 19:37:52 +0600 Subject: [PATCH 6/8] Remove output directory documentation Removed the section detailing the output directory and its usage. --- docs/DOCUMENTATION.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/docs/DOCUMENTATION.md b/docs/DOCUMENTATION.md index 1defd20..c55d64b 100644 --- a/docs/DOCUMENTATION.md +++ b/docs/DOCUMENTATION.md @@ -473,17 +473,6 @@ Set the filename template. Use ${variable_name} to insert variables. You can also create folders by inserting a path seperator in the filename You may use 'title', 'episode', 'showTitle', 'seriesTitle', 'season', 'width', 'height', 'service' as variables. -### Output Directory -#### `--outputDir` -| **Service** | **Usage** | **Type** | **Required** | **Alias** | **Default** | **cli-default Entry** | -| --- | --- | --- | --- | --- | --- | --- | -| All | `--outputDir ${outputDir}` | `string` | `No` | `NaN` | Final output is written to the default content directory when not set | `outputDir: ` | - - -Sets the output directory for the final muxed file. Use `${variable_name}` to insert variables. -You can also create subfolders by including path separators in the directory path. You may use `title`, `episode`, `showTitle`, `seriesTitle`, `season`, `width`, `height`, and `service` as variables. -example `--outputDir '/home/Anime/${seriesTitle}/S${season}/'` - #### `--numbers` | **Service** | **Usage** | **Type** | **Required** | **Alias** | **Default** |**cli-default Entry** | --- | --- | --- | --- | --- | --- | ---| From e9660c7c703dbe95a6318a69cf9602cf6ff3ec09 Mon Sep 17 00:00:00 2001 From: xnabil Date: Wed, 25 Mar 2026 19:59:18 +0600 Subject: [PATCH 7/8] feat: add outputDir option --- modules/module.args.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/module.args.ts b/modules/module.args.ts index e0e0ec3..6c81d14 100644 --- a/modules/module.args.ts +++ b/modules/module.args.ts @@ -666,18 +666,18 @@ const args: TAppArg[] = [ default: '[${service}] ${showTitle} - S${season}E${episode} [${height}p]' } }, - { - name: 'outputDir', - group: 'fileName', - describe: 'Set a custom directory for the final muxed file (supports template variables). Temporary files remain in the default content folder.', - docDescribe: true, - service: ['all'], - type: 'string', - usage: '${outputDir}', - default: { - default: '' - } - }, + { + name: 'outputDir', + group: 'fileName', + describe: 'Set a custom directory for the final muxed file (supports template variables). Temporary files remain in the default content folder.', + docDescribe: true, + service: ['all'], + type: 'string', + usage: '${outputDir}', + default: { + default: '' + } + }, { name: 'numbers', group: 'fileName', From 0d3d450985b56b89f22da0d653ee49aeee5a3a15 Mon Sep 17 00:00:00 2001 From: xnabil Date: Wed, 25 Mar 2026 20:00:45 +0600 Subject: [PATCH 8/8] feat: add outputDir option --- @types/crunchyTypes.d.ts | 1 + modules/module.app-args.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/@types/crunchyTypes.d.ts b/@types/crunchyTypes.d.ts index 4f07e7e..898020a 100644 --- a/@types/crunchyTypes.d.ts +++ b/@types/crunchyTypes.d.ts @@ -15,6 +15,7 @@ export type CrunchyDownloadOptions = { x: number; q: number; fileName: string; + outputDir?: string; numbers: number; partsize: number; callbackMaker?: (data: DownloadInfo) => HLSCallback; diff --git a/modules/module.app-args.ts b/modules/module.app-args.ts index 9a06b2c..6bf7460 100644 --- a/modules/module.app-args.ts +++ b/modules/module.app-args.ts @@ -68,6 +68,7 @@ export let argvC: { mp4: boolean; skipmux: boolean | undefined; fileName: string; + outputDir: string; numbers: number; nosess: string; debug: boolean | undefined;