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

[YouTube] Add support for automatic dubbed and secondary audio tracks #1237

Merged
merged 1 commit into from
Oct 27, 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
Original file line number Diff line number Diff line change
Expand Up @@ -1720,9 +1720,12 @@ public static AudioTrackType extractAudioTrackType(final String streamUrl) {
case "original":
return AudioTrackType.ORIGINAL;
case "dubbed":
case "dubbed-auto":
return AudioTrackType.DUBBED;
case "descriptive":
return AudioTrackType.DESCRIPTIVE;
case "secondary":
return AudioTrackType.SECONDARY;
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ private static String getRoleValue(@Nullable final AudioTrackType trackType) {
case DESCRIPTIVE:
return "description";
default:
// Secondary track types do not seem to have a dedicated role in the DASH
// specification, so use alternate for them
return "alternate";
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package org.schabi.newpipe.extractor.stream;

/**
* An enum representing the track type of an {@link AudioStream} extracted by a {@link
* An enum representing the track type of {@link AudioStream}s extracted by a {@link
* StreamExtractor}.
*/
public enum AudioTrackType {

/**
* An original audio track of the video.
* An original audio track of a video.
*/
ORIGINAL,

Expand All @@ -20,6 +21,7 @@ public enum AudioTrackType {

/**
* A descriptive audio track.
*
* <p>
* A descriptive audio track is an audio track in which descriptions of visual elements of
* a video are added to the original audio, with the goal to make a video more accessible to
Expand All @@ -29,5 +31,15 @@ public enum AudioTrackType {
* @see <a href="https://en.wikipedia.org/wiki/Audio_description">
* https://en.wikipedia.org/wiki/Audio_description</a>
*/
DESCRIPTIVE
DESCRIPTIVE,

/**
* A secondary audio track.
*
* <p>
* A secondary audio track can be an alternate audio track from the original language of a
* video or an alternate language.
* </p>
*/
SECONDARY
}
Loading