diff --git a/src/main/java/me/kavin/piped/utils/CollectionUtils.java b/src/main/java/me/kavin/piped/utils/CollectionUtils.java index 97f6791..24e1ff4 100644 --- a/src/main/java/me/kavin/piped/utils/CollectionUtils.java +++ b/src/main/java/me/kavin/piped/utils/CollectionUtils.java @@ -10,6 +10,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; import java.util.List; +import java.util.Optional; import static me.kavin.piped.utils.URLUtils.*; @@ -52,7 +53,9 @@ public class CollectionUtils { .forEach(stream -> audioStreams.add(new PipedStream(rewriteVideoURL(stream.getContent()), String.valueOf(stream.getFormat()), stream.getAverageBitrate() + " kbps", stream.getFormat().getMimeType(), false, stream.getBitrate(), stream.getInitStart(), - stream.getInitEnd(), stream.getIndexStart(), stream.getIndexEnd(), stream.getCodec(), stream.getAudioTrackId(), stream.getAudioTrackName()))); + stream.getInitEnd(), stream.getIndexStart(), stream.getIndexEnd(), stream.getCodec(), stream.getAudioTrackId(), stream.getAudioTrackName(), + Optional.ofNullable(stream.getAudioTrackType()).map(Enum::name).orElse(null) + ))); } final List relatedStreams = collectRelatedItems(info.getRelatedItems()); diff --git a/src/main/java/me/kavin/piped/utils/obj/PipedStream.java b/src/main/java/me/kavin/piped/utils/obj/PipedStream.java index 05fc012..33c41df 100644 --- a/src/main/java/me/kavin/piped/utils/obj/PipedStream.java +++ b/src/main/java/me/kavin/piped/utils/obj/PipedStream.java @@ -5,7 +5,7 @@ import lombok.NoArgsConstructor; @NoArgsConstructor public class PipedStream { - public String url, format, quality, mimeType, codec, audioTrackId, audioTrackName; + public String url, format, quality, mimeType, codec, audioTrackId, audioTrackName, audioTrackType; public boolean videoOnly; public int bitrate, initStart, initEnd, indexStart, indexEnd, width, height, fps; @@ -19,7 +19,7 @@ public class PipedStream { } public PipedStream(String url, String format, String quality, String mimeType, boolean videoOnly, int bitrate, - int initStart, int initEnd, int indexStart, int indexEnd, String codec, String audioTrackId, String audioTrackName) { + int initStart, int initEnd, int indexStart, int indexEnd, String codec, String audioTrackId, String audioTrackName, String audioTrackType) { this.url = url; this.format = format; this.quality = quality; @@ -33,6 +33,7 @@ public class PipedStream { this.codec = codec; this.audioTrackId = audioTrackId; this.audioTrackName = audioTrackName; + this.audioTrackType = audioTrackType; } public PipedStream(String url, String format, String quality, String mimeType, boolean videoOnly, int bitrate,