mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +00:00
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
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:
parent
75691d4bac
commit
28b85380c9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user