[YouTube] Add support for automatic dubbed and secondary tracks
This commit is contained in:
parent
abba78cf9d
commit
8a3350f79d
|
@ -1720,9 +1720,12 @@ public final class YoutubeParsingHelper {
|
||||||
case "original":
|
case "original":
|
||||||
return AudioTrackType.ORIGINAL;
|
return AudioTrackType.ORIGINAL;
|
||||||
case "dubbed":
|
case "dubbed":
|
||||||
|
case "dubbed-auto":
|
||||||
return AudioTrackType.DUBBED;
|
return AudioTrackType.DUBBED;
|
||||||
case "descriptive":
|
case "descriptive":
|
||||||
return AudioTrackType.DESCRIPTIVE;
|
return AudioTrackType.DESCRIPTIVE;
|
||||||
|
case "secondary":
|
||||||
|
return AudioTrackType.SECONDARY;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,6 +325,8 @@ public final class YoutubeDashManifestCreatorsUtils {
|
||||||
case DESCRIPTIVE:
|
case DESCRIPTIVE:
|
||||||
return "description";
|
return "description";
|
||||||
default:
|
default:
|
||||||
|
// Secondary track types do not seem to have a dedicated role in the DASH
|
||||||
|
// specification, so use alternate for them
|
||||||
return "alternate";
|
return "alternate";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package org.schabi.newpipe.extractor.stream;
|
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}.
|
* StreamExtractor}.
|
||||||
*/
|
*/
|
||||||
public enum AudioTrackType {
|
public enum AudioTrackType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An original audio track of the video.
|
* An original audio track of a video.
|
||||||
*/
|
*/
|
||||||
ORIGINAL,
|
ORIGINAL,
|
||||||
|
|
||||||
|
@ -20,6 +21,7 @@ public enum AudioTrackType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A descriptive audio track.
|
* A descriptive audio track.
|
||||||
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* A descriptive audio track is an audio track in which descriptions of visual elements of
|
* 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
|
* a video are added to the original audio, with the goal to make a video more accessible to
|
||||||
|
@ -29,5 +31,15 @@ public enum AudioTrackType {
|
||||||
* @see <a href="https://en.wikipedia.org/wiki/Audio_description">
|
* @see <a href="https://en.wikipedia.org/wiki/Audio_description">
|
||||||
* https://en.wikipedia.org/wiki/Audio_description</a>
|
* 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…
Reference in New Issue