mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 18:46:09 +00:00
api/youtube: pick a default track for videos with ai dubs
This commit is contained in:
parent
9f9300ebb8
commit
b14c618228
|
@ -263,6 +263,12 @@ export default async function(o) {
|
|||
|
||||
audio = selected.audio.find(i => i.isDefault);
|
||||
|
||||
// some videos (mainly those with AI dubs) don't have any tracks marked as default
|
||||
// why? god knows, but we assume that a default track is marked as such in the title
|
||||
if (!audio) {
|
||||
audio = selected.audio.find(i => i.name.endsWith("- original"));
|
||||
}
|
||||
|
||||
if (o.dubLang) {
|
||||
const dubbedAudio = selected.audio.find(i =>
|
||||
i.language === o.dubLang
|
||||
|
|
Loading…
Reference in a new issue