fix: NPE when extracting YT stream items without duration

This commit is contained in:
ThetaDev 2022-11-02 19:17:23 +01:00
parent f3b064a3b3
commit 0a458d8948
1 changed files with 6 additions and 2 deletions

View File

@ -141,6 +141,10 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
// example: "simple is best - 49 seconds - play video"
final String accessibilityLabel = videoInfo.getObject("accessibility")
.getObject("accessibilityData").getString("label");
if (accessibilityLabel == null) {
return 0;
}
final String[] labelParts = accessibilityLabel.split(" \u2013 ");
if (labelParts.length > 2) {