mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-05-12 04:50:33 +00:00
Merge 0d3d450985 into 548ac98613
This commit is contained in:
commit
d2e05a0215
7 changed files with 75 additions and 3 deletions
1
@types/crunchyTypes.d.ts
vendored
1
@types/crunchyTypes.d.ts
vendored
|
|
@ -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
21
adn.ts
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
21
crunchy.ts
21
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
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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**
|
||||
| --- | --- | --- | --- | --- | --- | ---|
|
||||
|
|
|
|||
21
hidive.ts
21
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
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ export let argvC: {
|
|||
mp4: boolean;
|
||||
skipmux: boolean | undefined;
|
||||
fileName: string;
|
||||
outputDir: string;
|
||||
numbers: number;
|
||||
nosess: string;
|
||||
debug: boolean | undefined;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue