Display error on youtube-dl get info failure
This commit is contained in:
parent
e5d771a390
commit
ea139ca870
3 changed files with 5 additions and 1 deletions
|
@ -126,6 +126,8 @@ export class YoutubeDLCLI {
|
|||
const completeArgs = additionalYoutubeDLArgs.concat([ '--dump-json', '-f', format ])
|
||||
|
||||
const data = await this.run({ url, args: completeArgs, processOptions })
|
||||
if (!data) return undefined
|
||||
|
||||
const info = data.map(this.parseInfo)
|
||||
|
||||
return info.length === 1
|
||||
|
|
|
@ -39,6 +39,8 @@ class YoutubeDLWrapper {
|
|||
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.')
|
||||
|
||||
const infoBuilder = new YoutubeDLInfoBuilder(info)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe('Test jobs', 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: 'video2' } })
|
||||
|
|
Loading…
Reference in a new issue