Update YoutubeStreamExtractor.java

To fix ``java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference``
This commit is contained in:
litetex 2021-06-08 20:30:13 +02:00
parent 4e41e172ea
commit 17ccaf4b87

View File

@ -1049,7 +1049,16 @@ public class YoutubeStreamExtractor extends StreamExtractor {
storyboardsRenderer = storyboards.getObject("playerStoryboardSpecRenderer");
}
final String[] spec = storyboardsRenderer.getString("spec").split("\\|");
if (storyboardsRenderer == null) {
return new ArrayList<>();
}
final String storyboardsRendererSpec = storyboardsRenderer.getString("spec");
if (storyboardsRendererSpec == null) {
return new ArrayList<>();
}
final String[] spec = storyboardsRendererSpec.split("\\|");
final String url = spec[0];
final ArrayList<Frameset> result = new ArrayList<>(spec.length - 1);