From fb5af1e4516d056b525382b949b5fa5db6765cd7 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:00:09 +0200 Subject: [PATCH 1/2] Invidious API: Add support for auto-dubbed audio tracks --- src/renderer/helpers/player/utils.js | 1 + src/renderer/views/Watch/Watch.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/helpers/player/utils.js b/src/renderer/helpers/player/utils.js index f25a3068a8c24..218475a060c73 100644 --- a/src/renderer/helpers/player/utils.js +++ b/src/renderer/helpers/player/utils.js @@ -273,6 +273,7 @@ export function repairInvidiousManifest(periods) { labelParts.push('original') break case 'dubbed': + case 'dubbed-auto': role = 'dub' break case 'descriptive': diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 082ef53682cd8..bf1032e0661cc 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -1387,7 +1387,7 @@ export default defineComponent({ if (localFormat.has_audio) { audioFormats.push(localFormat) - if (localFormat.is_dubbed || localFormat.is_descriptive || localFormat.is_secondary) { + if (localFormat.is_dubbed || localFormat.is_descriptive || localFormat.is_secondary || localFormat.is_auto_dubbed) { hasMultipleAudioTracks = true } } @@ -1435,6 +1435,9 @@ export default defineComponent({ } else if (format.is_secondary) { type = ' secondary' idNumber = 6 + } else if (format.is_auto_dubbed) { + type = '' + idNumber = 10 } else { type = ' alternative' idNumber = -1 From 5b0164885256af6a8723fef8a03d3c7d243347f5 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:45:00 +0100 Subject: [PATCH 2/2] Use the standard display name format --- src/renderer/helpers/player/utils.js | 2 +- src/renderer/views/Watch/Watch.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/helpers/player/utils.js b/src/renderer/helpers/player/utils.js index 218475a060c73..983a275bba2b3 100644 --- a/src/renderer/helpers/player/utils.js +++ b/src/renderer/helpers/player/utils.js @@ -214,7 +214,7 @@ export function repairInvidiousManifest(periods) { } // match YouTube's local API response with English - const languageNames = new Intl.DisplayNames('en-US', { type: 'language' }) + const languageNames = new Intl.DisplayNames('en-US', { type: 'language', languageDisplay: 'standard' }) for (const audioAdaptationSet of audioAdaptationSets) { // Invidious adds a label to every audio stream with it's bitrate diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index bf1032e0661cc..3b1e3e2b38ce5 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -1397,7 +1397,7 @@ export default defineComponent({ if (hasMultipleAudioTracks) { // match YouTube's local API response with English - const languageNames = new Intl.DisplayNames('en-US', { type: 'language' }) + const languageNames = new Intl.DisplayNames('en-US', { type: 'language', languageDisplay: 'standard' }) for (const format of audioFormats) { this.generateAudioTrackFieldInvidious(format, languageNames) }