aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/youtube-dl
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-21 08:33:27 +0100
committerChocobozzz <me@florianbigard.com>2022-03-21 08:34:45 +0100
commit88f169278179a415937cd64d9404c618bcf4b54e (patch)
treef25b34aa90c289545088d05377e6199eec3c1bab /server/helpers/youtube-dl
parent4e5e072c1b2f40f76a0df1b66a4a6949c42641df (diff)
downloadPeerTube-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.ts6
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 @@
1import execa from 'execa' 1import execa from 'execa'
2import { pathExists, writeFile } from 'fs-extra' 2import { ensureDir, pathExists, writeFile } from 'fs-extra'
3import { join } from 'path' 3import { dirname, join } from 'path'
4import { CONFIG } from '@server/initializers/config' 4import { CONFIG } from '@server/initializers/config'
5import { VideoResolution } from '@shared/models' 5import { VideoResolution } from '@shared/models'
6import { logger, loggerTagsFactory } from '../logger' 6import { 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