aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/youtube-dl
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/youtube-dl')
-rw-r--r--server/helpers/youtube-dl/youtube-dl-cli.ts2
-rw-r--r--server/helpers/youtube-dl/youtube-dl-wrapper.ts2
2 files changed, 4 insertions, 0 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-cli.ts b/server/helpers/youtube-dl/youtube-dl-cli.ts
index 5a87b99b4..508055b85 100644
--- a/server/helpers/youtube-dl/youtube-dl-cli.ts
+++ b/server/helpers/youtube-dl/youtube-dl-cli.ts
@@ -126,6 +126,8 @@ export class YoutubeDLCLI {
126 const completeArgs = additionalYoutubeDLArgs.concat([ '--dump-json', '-f', format ]) 126 const completeArgs = additionalYoutubeDLArgs.concat([ '--dump-json', '-f', format ])
127 127
128 const data = await this.run({ url, args: completeArgs, processOptions }) 128 const data = await this.run({ url, args: completeArgs, processOptions })
129 if (!data) return undefined
130
129 const info = data.map(this.parseInfo) 131 const info = data.map(this.parseInfo)
130 132
131 return info.length === 1 133 return info.length === 1
diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
index 7cd5e3310..3264cc9ff 100644
--- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts
+++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
@@ -39,6 +39,8 @@ class YoutubeDLWrapper {
39 processOptions 39 processOptions
40 }) 40 })
41 41
42 if (!info) throw new Error(`YoutubeDL could not get info from ${this.url}`)
43
42 if (info.is_live === true) throw new Error('Cannot download a live streaming.') 44 if (info.is_live === true) throw new Error('Cannot download a live streaming.')
43 45
44 const infoBuilder = new YoutubeDLInfoBuilder(info) 46 const infoBuilder = new YoutubeDLInfoBuilder(info)