Fix channels import with a channel with playlists

pull/3467/head
Chocobozzz 2020-12-14 09:54:38 +01:00
parent d8794cf855
commit 5721fd8374
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 8 additions and 3 deletions

View File

@ -74,10 +74,15 @@ async function run (url: string, user: UserInfo) {
let info = await getYoutubeDLInfo(youtubeDL, program['targetUrl'], command.args)
if (info?.title === 'Uploads') {
console.log('Fixing URL to %s.', info.url)
if (!Array.isArray(info)) info = [ info ]
info = await getYoutubeDLInfo(youtubeDL, info.url, command.args)
// Try to fix youtube channels upload
const uploadsObject = info.find(i => !i.ie_key && !i.duration && i.title === 'Uploads')
if (uploadsObject) {
console.log('Fixing URL to %s.', uploadsObject.url)
info = await getYoutubeDLInfo(youtubeDL, uploadsObject.url, command.args)
}
let infoArray: any[]