Code improvements
* Throw ContentNotSupportedExceptions when extracting (as was done before)
This commit is contained in:
parent
ff8eb685f3
commit
fa57ec08d2
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue