api/vk: allow auto generated subs & pick explicitly vtt

i couldn't find a single video that had any subtitles other than auto generated ones, so i think this is better than nothing at all
This commit is contained in:
wukko
2025-06-24 17:56:04 +06:00
parent 75691d4bac
commit 28b85380c9

View File

@@ -128,7 +128,7 @@ export default async function ({ ownerId, videoId, accessKey, quality, subtitleL
let subtitles; let subtitles;
if (subtitleLang && video.subtitles?.length) { if (subtitleLang && video.subtitles?.length) {
const subtitle = video.subtitles.find( const subtitle = video.subtitles.find(
s => !s.is_auto && s.lang.startsWith(subtitleLang) s => s.title.endsWith(".vtt") && s.lang.startsWith(subtitleLang)
); );
if (subtitle) { if (subtitle) {
subtitles = subtitle.url; subtitles = subtitle.url;