first proposal download path selection

This commit is contained in:
2022-09-24 12:53:36 +02:00
parent 8fcb585519
commit b037c041f4
7 changed files with 144 additions and 24 deletions

View File

@@ -41,6 +41,12 @@ class Process {
public async start(callback?: Function): Promise<this> {
const sanitizedParams = this.params.filter((param: string) => availableParams.includes(param));
if (this.settings?.download_path) {
if (this.settings.download_path.charAt(this.settings.download_path.length - 1) !== '/') {
this.settings.download_path = `${this.settings.download_path}/`
}
}
const ytldp = spawn(this.exePath,
['-o', `${this.settings?.download_path || 'downloads/'}%(title)s.%(ext)s`]
.concat(sanitizedParams)