aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/youtube-dl/youtube-dl-wrapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/youtube-dl/youtube-dl-wrapper.ts')
-rw-r--r--server/helpers/youtube-dl/youtube-dl-wrapper.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
index d585e9a95..176cf3b69 100644
--- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts
+++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
@@ -21,7 +21,11 @@ const processOptions = {
21 21
22class YoutubeDLWrapper { 22class YoutubeDLWrapper {
23 23
24 constructor (private readonly url: string = '', private readonly enabledResolutions: number[] = []) { 24 constructor (
25 private readonly url: string,
26 private readonly enabledResolutions: number[],
27 private readonly useBestFormat: boolean
28 ) {
25 29
26 } 30 }
27 31
@@ -30,7 +34,7 @@ class YoutubeDLWrapper {
30 34
31 const info = await youtubeDL.getInfo({ 35 const info = await youtubeDL.getInfo({
32 url: this.url, 36 url: this.url,
33 format: YoutubeDLCLI.getYoutubeDLVideoFormat(this.enabledResolutions), 37 format: YoutubeDLCLI.getYoutubeDLVideoFormat(this.enabledResolutions, this.useBestFormat),
34 additionalYoutubeDLArgs: youtubeDLArgs, 38 additionalYoutubeDLArgs: youtubeDLArgs,
35 processOptions 39 processOptions
36 }) 40 })
@@ -80,7 +84,7 @@ class YoutubeDLWrapper {
80 try { 84 try {
81 await youtubeDL.download({ 85 await youtubeDL.download({
82 url: this.url, 86 url: this.url,
83 format: YoutubeDLCLI.getYoutubeDLVideoFormat(this.enabledResolutions), 87 format: YoutubeDLCLI.getYoutubeDLVideoFormat(this.enabledResolutions, this.useBestFormat),
84 output: pathWithoutExtension, 88 output: pathWithoutExtension,
85 timeout, 89 timeout,
86 processOptions 90 processOptions