Enabled custom yt-dlp arguments in settings.json

This commit is contained in:
2022-06-04 15:03:24 +02:00
parent 7dd812050a
commit 52cffed0dc
7 changed files with 131 additions and 95 deletions

View File

@@ -2,8 +2,8 @@ import { spawn } from 'child_process';
import { join } from 'path';
import { Readable } from 'stream';
import { ISettings } from '../interfaces/ISettings';
import Logger from '../utils/BetterLogger';
import { availableParams } from '../utils/params';
import Logger from '../utils/BetterLogger';
const log = new Logger();
@@ -45,6 +45,7 @@ class Process {
const ytldp = spawn(this.exePath,
['-o', `${this.settings?.download_path || 'downloads/'}%(title)s.%(ext)s`]
.concat(sanitizedParams)
.concat((this.settings?.cliArgs ?? []).map(arg => arg.split(' ')).flat())
.concat([this.url])
);