mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +00:00
api/rutube: add subtitles
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
This commit is contained in:
parent
3dae5b2eb0
commit
f4637b746c
@ -221,6 +221,7 @@ export default async function({ host, patternMatch, params, isSession, isApiKey
|
||||
key: patternMatch.key,
|
||||
quality: params.videoQuality,
|
||||
isAudioOnly,
|
||||
subtitleLang,
|
||||
});
|
||||
break;
|
||||
|
||||
|
@ -65,8 +65,21 @@ export default async function(obj) {
|
||||
artist: play.author.name.trim(),
|
||||
}
|
||||
|
||||
let subtitles;
|
||||
if (obj.subtitleLang && play.captions?.length) {
|
||||
const subtitle = play.captions.find(
|
||||
s => ["webvtt", "srt"].includes(s.format) && s.code.startsWith(obj.subtitleLang)
|
||||
);
|
||||
|
||||
if (subtitle) {
|
||||
subtitles = subtitle.file;
|
||||
fileMetadata.sublanguage = obj.subtitleLang;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
urls: matchingQuality.uri,
|
||||
subtitles,
|
||||
isHLS: true,
|
||||
filenameAttributes: {
|
||||
service: "rutube",
|
||||
|
Loading…
Reference in New Issue
Block a user