adress stypox review

This commit is contained in:
bopol 2021-06-23 11:15:40 +02:00
parent c998012c28
commit 58f109ddec
1 changed files with 7 additions and 5 deletions

View File

@ -62,16 +62,18 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
}
final JsonArray badges = videoInfo.getArray("badges");
for (Object badge : badges) {
for (final Object badge : badges) {
if (((JsonObject) badge).getObject("metadataBadgeRenderer").getString("label", EMPTY_STRING).equals("LIVE NOW")) {
return cachedStreamType = StreamType.LIVE_STREAM;
}
}
final String style = videoInfo.getArray("thumbnailOverlays").getObject(0)
.getObject("thumbnailOverlayTimeStatusRenderer").getString("style", EMPTY_STRING);
if (style.equalsIgnoreCase("LIVE")) {
return cachedStreamType = StreamType.LIVE_STREAM;
for (final Object overlay : videoInfo.getArray("thumbnailOverlays")) {
final String style = ((JsonObject) overlay)
.getObject("thumbnailOverlayTimeStatusRenderer").getString("style", EMPTY_STRING);
if (style.equalsIgnoreCase("LIVE")) {
return cachedStreamType = StreamType.LIVE_STREAM;
}
}
return cachedStreamType = StreamType.VIDEO_STREAM;