mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
api/youtube: pick a default track for videos with ai dubs
This commit is contained in:
parent
9f9300ebb8
commit
b14c618228
1 changed files with 6 additions and 0 deletions
|
@ -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