diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreator/YoutubeOtfDashManifestCreator.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreator/YoutubeOtfDashManifestCreator.java index a29f48a63..4762d3587 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreator/YoutubeOtfDashManifestCreator.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreator/YoutubeOtfDashManifestCreator.java @@ -50,11 +50,9 @@ public class YoutubeOtfDashManifestCreator extends AbstractYoutubeDashManifestCr // Get all durations and repetitions which are separated by a comma .split(","); final int lastIndex = segmentsAndDurationsResponseSplit.length - 1; - if (isBlank(segmentsAndDurationsResponseSplit[lastIndex])) { - segmentDurations = Arrays.copyOf(segmentsAndDurationsResponseSplit, lastIndex); - } else { - segmentDurations = segmentsAndDurationsResponseSplit; - } + segmentDurations = isBlank(segmentsAndDurationsResponseSplit[lastIndex]) + ? Arrays.copyOf(segmentsAndDurationsResponseSplit, lastIndex) + : segmentsAndDurationsResponseSplit; } catch (final Exception e) { throw new DashManifestCreationException("Could not get segment durations", e); } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java index 5b5710945..2c16ce71b 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java @@ -523,6 +523,8 @@ public class StreamInfo extends Info { /* Extract video stream url */ try { streamInfo.setVideoStreams(extractor.getVideoStreams()); + } catch (final ContentNotSupportedException e) { + throw e; } catch (final Exception e) { streamInfo.addError(new ExtractionException("Couldn't get video streams", e)); } @@ -530,6 +532,8 @@ public class StreamInfo extends Info { /* Extract video only stream url */ try { streamInfo.setVideoOnlyStreams(extractor.getVideoOnlyStreams()); + } catch (final ContentNotSupportedException e) { + throw e; } catch (final Exception e) { streamInfo.addError(new ExtractionException("Couldn't get video only streams", e)); }