api/vk: allow auto generated subs & pick explicitly vtt
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run

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
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

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