Fix subtitles import

pull/5487/head
Chocobozzz 2021-04-08 14:29:03 +02:00
parent f6160062f8
commit 4c7449d2ad
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ function getYoutubeDLSubs (url: string, opts?: object): Promise<YoutubeDLSubs> {
logger.debug('Get subtitles from youtube dl.', { url, files })
const subtitles = files.reduce((acc, filename) => {
const matched = filename.match(/\.([a-z]{2})\.(vtt|ttml)/i)
const matched = filename.match(/\.([a-z]{2})(-[a-z]+)?\.(vtt|ttml)/i)
if (!matched || !matched[1]) return acc
return [