mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-01-11 20:10:20 +00:00
[HD] Download first available audio if language association can't be made.
This commit is contained in:
parent
993eecf619
commit
1e45610a7b
1 changed files with 13 additions and 2 deletions
15
hidive.ts
15
hidive.ts
|
|
@ -760,8 +760,19 @@ export default class Hidive implements ServiceClass {
|
|||
}
|
||||
}
|
||||
if (chosenAudios.length == 0) {
|
||||
console.error(`Chosen audio language(s) does not exist for episode ${selectedEpisode.episodeInformation.episodeNumber}`);
|
||||
return undefined;
|
||||
console.warn(`Chosen audio language(s) does not exist for episode ${selectedEpisode.episodeInformation.episodeNumber}, falling back to first available audio`);
|
||||
if (audios.length > 0) {
|
||||
let chosenAudioQuality = options.q === 0 ? audios.length : options.q;
|
||||
if(chosenAudioQuality > audios.length) {
|
||||
chosenAudioQuality = audios.length;
|
||||
}
|
||||
chosenAudioQuality--;
|
||||
chosenAudios.push(audios[chosenAudioQuality]);
|
||||
console.info(`Using audio track: ${audios[chosenAudioQuality].language.code || 'unknown'}`);
|
||||
} else {
|
||||
console.error(`No audio tracks available for episode ${selectedEpisode.episodeInformation.episodeNumber}`);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const fileName = parseFileName(options.fileName, variables, options.numbers, options.override).join(path.sep);
|
||||
|
|
|
|||
Loading…
Reference in a new issue