Display error on youtube-dl get info failure
This commit is contained in:
parent
e5d771a390
commit
ea139ca870
|
@ -126,6 +126,8 @@ export class YoutubeDLCLI {
|
||||||
const completeArgs = additionalYoutubeDLArgs.concat([ '--dump-json', '-f', format ])
|
const completeArgs = additionalYoutubeDLArgs.concat([ '--dump-json', '-f', format ])
|
||||||
|
|
||||||
const data = await this.run({ url, args: completeArgs, processOptions })
|
const data = await this.run({ url, args: completeArgs, processOptions })
|
||||||
|
if (!data) return undefined
|
||||||
|
|
||||||
const info = data.map(this.parseInfo)
|
const info = data.map(this.parseInfo)
|
||||||
|
|
||||||
return info.length === 1
|
return info.length === 1
|
||||||
|
|
|
@ -39,6 +39,8 @@ class YoutubeDLWrapper {
|
||||||
processOptions
|
processOptions
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!info) throw new Error(`YoutubeDL could not get info from ${this.url}`)
|
||||||
|
|
||||||
if (info.is_live === true) throw new Error('Cannot download a live streaming.')
|
if (info.is_live === true) throw new Error('Cannot download a live streaming.')
|
||||||
|
|
||||||
const infoBuilder = new YoutubeDLInfoBuilder(info)
|
const infoBuilder = new YoutubeDLInfoBuilder(info)
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe('Test jobs', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should create some jobs', async function () {
|
it('Should create some jobs', async function () {
|
||||||
this.timeout(120000)
|
this.timeout(240000)
|
||||||
|
|
||||||
await servers[1].videos.upload({ attributes: { name: 'video1' } })
|
await servers[1].videos.upload({ attributes: { name: 'video1' } })
|
||||||
await servers[1].videos.upload({ attributes: { name: 'video2' } })
|
await servers[1].videos.upload({ attributes: { name: 'video2' } })
|
||||||
|
|
Loading…
Reference in New Issue