diff options
-rw-r--r-- | server/helpers/youtube-dl.ts | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index 2014aab0a..bb5930952 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts | |||
@@ -67,17 +67,16 @@ function getYoutubeDLSubs (url: string, opts?: object): Promise<YoutubeDLSubs> { | |||
67 | 67 | ||
68 | const subtitles = files.reduce((acc, filename) => { | 68 | const subtitles = files.reduce((acc, filename) => { |
69 | const matched = filename.match(/\.([a-z]{2})\.(vtt|ttml)/i) | 69 | const matched = filename.match(/\.([a-z]{2})\.(vtt|ttml)/i) |
70 | 70 | if (!matched || !matched[1]) return acc | |
71 | if (matched[1]) { | 71 | |
72 | return [ | 72 | return [ |
73 | ...acc, | 73 | ...acc, |
74 | { | 74 | { |
75 | language: matched[1], | 75 | language: matched[1], |
76 | path: join(cwd, filename), | 76 | path: join(cwd, filename), |
77 | filename | 77 | filename |
78 | } | 78 | } |
79 | ] | 79 | ] |
80 | } | ||
81 | }, []) | 80 | }, []) |
82 | 81 | ||
83 | return res(subtitles) | 82 | return res(subtitles) |