Ensure bin dir exists before dl youtube-dl

pull/4897/head
Chocobozzz 2022-03-21 08:33:27 +01:00
parent 4e5e072c1b
commit 88f1692781
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import execa from 'execa'
import { pathExists, writeFile } from 'fs-extra'
import { join } from 'path'
import { ensureDir, pathExists, writeFile } from 'fs-extra'
import { dirname, join } from 'path'
import { CONFIG } from '@server/initializers/config'
import { VideoResolution } from '@shared/models'
import { logger, loggerTagsFactory } from '../logger'
@ -15,6 +15,8 @@ export class YoutubeDLCLI {
static async safeGet () {
if (!await pathExists(youtubeDLBinaryPath)) {
await ensureDir(dirname(youtubeDLBinaryPath))
await this.updateYoutubeDLBinary()
}