Enabled custom yt-dlp arguments in settings.json
This commit is contained in:
@@ -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])
|
||||
);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const log = new Logger();
|
||||
const pool = new ProcessPool();
|
||||
|
||||
try {
|
||||
settings = require('../settings.json');
|
||||
settings = require('../../settings.json');
|
||||
}
|
||||
catch (e) {
|
||||
new Promise(resolve => setTimeout(resolve, 500))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export interface ISettings {
|
||||
download_path: string
|
||||
download_path: string,
|
||||
cliArgs?: string[],
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export const availableParams = [
|
||||
'--no-mtime',
|
||||
'-x'
|
||||
'-x',
|
||||
]
|
||||
Reference in New Issue
Block a user