Fix youtube video import
This commit is contained in:
parent
fef13f1480
commit
9fa0ea41aa
1 changed files with 2 additions and 2 deletions
|
@ -24,10 +24,10 @@ const processOptions = {
|
||||||
|
|
||||||
function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> {
|
function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> {
|
||||||
return new Promise<YoutubeDLInfo>(async (res, rej) => {
|
return new Promise<YoutubeDLInfo>(async (res, rej) => {
|
||||||
const options = opts || [ '-j', '--flat-playlist' ]
|
const args = opts || [ '-j', '--flat-playlist' ]
|
||||||
|
|
||||||
const youtubeDL = await safeGetYoutubeDL()
|
const youtubeDL = await safeGetYoutubeDL()
|
||||||
youtubeDL.getInfo(url, options, (err, info) => {
|
youtubeDL.getInfo(url, args, processOptions, (err, info) => {
|
||||||
if (err) return rej(err)
|
if (err) return rej(err)
|
||||||
if (info.is_live === true) return rej(new Error('Cannot download a live streaming.'))
|
if (info.is_live === true) return rej(new Error('Cannot download a live streaming.'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue