Skip to content

Commit

Permalink
fix(YouTube - Force original audio): Use correct original audio strea…
Browse files Browse the repository at this point in the history
…m if app language is not English
  • Loading branch information
LisoUseInAIKyrios committed Dec 20, 2024
1 parent f342e26 commit 0d20171
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@SuppressWarnings("unused")
public class ForceOriginalAudioPatch {

private static final String DEFAULT_AUDIO_TRACKS_IDENTIFIER = "original";
private static final String DEFAULT_AUDIO_TRACKS_SUFFIX = ".4";

/**
* Injection point.
Expand All @@ -17,7 +17,7 @@ public static boolean isDefaultAudioStream(boolean isDefault, String audioTrackI
return isDefault;
}

if (audioTrackDisplayName.isEmpty()) {
if (audioTrackId.isEmpty()) {
// Older app targets can have empty audio tracks and these might be placeholders.
// The real audio tracks are called after these.
return isDefault;
Expand All @@ -26,7 +26,7 @@ public static boolean isDefaultAudioStream(boolean isDefault, String audioTrackI
Logger.printDebug(() -> "default: " + String.format("%-5s", isDefault) + " id: "
+ String.format("%-8s", audioTrackId) + " name:" + audioTrackDisplayName);

final boolean isOriginal = audioTrackDisplayName.contains(DEFAULT_AUDIO_TRACKS_IDENTIFIER);
final boolean isOriginal = audioTrackId.endsWith(DEFAULT_AUDIO_TRACKS_SUFFIX);
if (isOriginal) {
Logger.printDebug(() -> "Using audio: " + audioTrackId);
}
Expand Down

0 comments on commit 0d20171

Please sign in to comment.