1
0
Fork 0

Display error on youtube-dl get info failure

This commit is contained in:
Chocobozzz 2022-08-18 11:40:07 +02:00
parent e5d771a390
commit ea139ca870
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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' } })