Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/LuanRT/YouTube.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Oct 28, 2024
2 parents d9ec23c + a4ef224 commit 85d623c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/parser/classes/misc/Format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default class Format {
has_text: boolean;
language?: string | null;
is_dubbed?: boolean;
is_auto_dubbed?: boolean;
is_descriptive?: boolean;
is_secondary?: boolean;
is_original?: boolean;
Expand Down Expand Up @@ -224,7 +225,8 @@ export default class Format {
this.is_dubbed = audio_content === 'dubbed';
this.is_descriptive = audio_content === 'descriptive';
this.is_secondary = audio_content === 'secondary';
this.is_original = audio_content === 'original' || (!this.is_dubbed && !this.is_descriptive && !this.is_secondary && !this.is_drc);
this.is_auto_dubbed = audio_content === 'dubbed-auto';
this.is_original = audio_content === 'original' || (!this.is_dubbed && !this.is_descriptive && !this.is_secondary && !this.is_auto_dubbed && !this.is_drc);
}

// Some text tracks don't have xtags while others do
Expand Down
2 changes: 1 addition & 1 deletion src/utils/StreamingInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ function getTrackRoles(format: Format, has_drc_streams: boolean) {
format.is_original ? 'main' : 'alternate'
];

if (format.is_dubbed)
if (format.is_dubbed || format.is_auto_dubbed)
roles.push('dub');

if (format.is_descriptive)
Expand Down

0 comments on commit 85d623c

Please sign in to comment.