diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-21 08:33:27 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-21 08:34:45 +0100 |
commit | 88f169278179a415937cd64d9404c618bcf4b54e (patch) | |
tree | f25b34aa90c289545088d05377e6199eec3c1bab /server/helpers/youtube-dl | |
parent | 4e5e072c1b2f40f76a0df1b66a4a6949c42641df (diff) | |
download | PeerTube-88f169278179a415937cd64d9404c618bcf4b54e.tar.gz PeerTube-88f169278179a415937cd64d9404c618bcf4b54e.tar.zst PeerTube-88f169278179a415937cd64d9404c618bcf4b54e.zip |
Ensure bin dir exists before dl youtube-dl
Diffstat (limited to 'server/helpers/youtube-dl')
-rw-r--r-- | server/helpers/youtube-dl/youtube-dl-cli.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-cli.ts b/server/helpers/youtube-dl/youtube-dl-cli.ts index 30fd1c97d..728f096b5 100644 --- a/server/helpers/youtube-dl/youtube-dl-cli.ts +++ b/server/helpers/youtube-dl/youtube-dl-cli.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import execa from 'execa' | 1 | import execa from 'execa' |
2 | import { pathExists, writeFile } from 'fs-extra' | 2 | import { ensureDir, pathExists, writeFile } from 'fs-extra' |
3 | import { join } from 'path' | 3 | import { dirname, join } from 'path' |
4 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
5 | import { VideoResolution } from '@shared/models' | 5 | import { VideoResolution } from '@shared/models' |
6 | import { logger, loggerTagsFactory } from '../logger' | 6 | import { logger, loggerTagsFactory } from '../logger' |
@@ -15,6 +15,8 @@ export class YoutubeDLCLI { | |||
15 | 15 | ||
16 | static async safeGet () { | 16 | static async safeGet () { |
17 | if (!await pathExists(youtubeDLBinaryPath)) { | 17 | if (!await pathExists(youtubeDLBinaryPath)) { |
18 | await ensureDir(dirname(youtubeDLBinaryPath)) | ||
19 | |||
18 | await this.updateYoutubeDLBinary() | 20 | await this.updateYoutubeDLBinary() |
19 | } | 21 | } |
20 | 22 | ||