Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix subtitles import

Chocobozzz4c7449d2add4
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts
index 8537a57722..5b46f704a2 100644
--- a/server/helpers/youtube-dl.ts
+++ b/server/helpers/youtube-dl.ts
@@ -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 [