This commit is contained in:
Nabil Khan 2026-04-14 17:16:57 +02:00 committed by GitHub
commit d2e05a0215
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 75 additions and 3 deletions

View file

@ -15,6 +15,7 @@ export type CrunchyDownloadOptions = {
x: number;
q: number;
fileName: string;
outputDir?: string;
numbers: number;
partsize: number;
callbackMaker?: (data: DownloadInfo) => HLSCallback;

21
adn.ts
View file

@ -965,10 +965,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
};
}

View file

@ -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
};
}

View file

@ -472,6 +472,7 @@ 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.
#### `--numbers`
| **Service** | **Usage** | **Type** | **Required** | **Alias** | **Default** |**cli-default Entry**
| --- | --- | --- | --- | --- | --- | ---|

View file

@ -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
};
}

View file

@ -68,6 +68,7 @@ export let argvC: {
mp4: boolean;
skipmux: boolean | undefined;
fileName: string;
outputDir: string;
numbers: number;
nosess: string;
debug: boolean | undefined;

View file

@ -666,6 +666,18 @@ const args: TAppArg<boolean | number | string | unknown[]>[] = [
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',