mirror of https://github.com/Chocobozzz/PeerTube
Ensure bin dir exists before dl youtube-dl
parent
4e5e072c1b
commit
88f1692781
|
@ -1,6 +1,6 @@
|
||||||
import execa from 'execa'
|
import execa from 'execa'
|
||||||
import { pathExists, writeFile } from 'fs-extra'
|
import { ensureDir, pathExists, writeFile } from 'fs-extra'
|
||||||
import { join } from 'path'
|
import { dirname, join } from 'path'
|
||||||
import { CONFIG } from '@server/initializers/config'
|
import { CONFIG } from '@server/initializers/config'
|
||||||
import { VideoResolution } from '@shared/models'
|
import { VideoResolution } from '@shared/models'
|
||||||
import { logger, loggerTagsFactory } from '../logger'
|
import { logger, loggerTagsFactory } from '../logger'
|
||||||
|
@ -15,6 +15,8 @@ export class YoutubeDLCLI {
|
||||||
|
|
||||||
static async safeGet () {
|
static async safeGet () {
|
||||||
if (!await pathExists(youtubeDLBinaryPath)) {
|
if (!await pathExists(youtubeDLBinaryPath)) {
|
||||||
|
await ensureDir(dirname(youtubeDLBinaryPath))
|
||||||
|
|
||||||
await this.updateYoutubeDLBinary()
|
await this.updateYoutubeDLBinary()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue