Skip to content

Commit 58f109d

Browse files
committed
adress stypox review
1 parent c998012 commit 58f109d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,18 @@ public StreamType getStreamType() {
6262
}
6363

6464
final JsonArray badges = videoInfo.getArray("badges");
65-
for (Object badge : badges) {
65+
for (final Object badge : badges) {
6666
if (((JsonObject) badge).getObject("metadataBadgeRenderer").getString("label", EMPTY_STRING).equals("LIVE NOW")) {
6767
return cachedStreamType = StreamType.LIVE_STREAM;
6868
}
6969
}
7070

71-
final String style = videoInfo.getArray("thumbnailOverlays").getObject(0)
72-
.getObject("thumbnailOverlayTimeStatusRenderer").getString("style", EMPTY_STRING);
73-
if (style.equalsIgnoreCase("LIVE")) {
74-
return cachedStreamType = StreamType.LIVE_STREAM;
71+
for (final Object overlay : videoInfo.getArray("thumbnailOverlays")) {
72+
final String style = ((JsonObject) overlay)
73+
.getObject("thumbnailOverlayTimeStatusRenderer").getString("style", EMPTY_STRING);
74+
if (style.equalsIgnoreCase("LIVE")) {
75+
return cachedStreamType = StreamType.LIVE_STREAM;
76+
}
7577
}
7678

7779
return cachedStreamType = StreamType.VIDEO_STREAM;

0 commit comments

Comments
 (0)