Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invidious API: Add support for auto-dubbed audio tracks #5943

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/renderer/helpers/player/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -273,6 +273,7 @@ export function repairInvidiousManifest(periods) {
labelParts.push('original')
break
case 'dubbed':
case 'dubbed-auto':
role = 'dub'
break
case 'descriptive':
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down