Correctly fix subtitles import
This commit is contained in:
parent
49919ca16b
commit
982f2fc9b4
|
@ -67,8 +67,8 @@ function getYoutubeDLSubs (url: string, opts?: object): Promise<YoutubeDLSubs> {
|
||||||
|
|
||||||
const subtitles = files.reduce((acc, filename) => {
|
const subtitles = files.reduce((acc, filename) => {
|
||||||
const matched = filename.match(/\.([a-z]{2})\.(vtt|ttml)/i)
|
const matched = filename.match(/\.([a-z]{2})\.(vtt|ttml)/i)
|
||||||
|
if (!matched || !matched[1]) return acc
|
||||||
|
|
||||||
if (matched[1]) {
|
|
||||||
return [
|
return [
|
||||||
...acc,
|
...acc,
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,6 @@ function getYoutubeDLSubs (url: string, opts?: object): Promise<YoutubeDLSubs> {
|
||||||
filename
|
filename
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return res(subtitles)
|
return res(subtitles)
|
||||||
|
|
Loading…
Reference in New Issue