Use badge style instead of label

This commit is contained in:
bopol 2021-06-23 11:25:59 +02:00
parent 58f109ddec
commit 361f142621
1 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,9 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
final JsonArray badges = videoInfo.getArray("badges");
for (final Object badge : badges) {
if (((JsonObject) badge).getObject("metadataBadgeRenderer").getString("label", EMPTY_STRING).equals("LIVE NOW")) {
final JsonObject badgeRenderer = ((JsonObject) badge).getObject("metadataBadgeRenderer");
if (badgeRenderer.getString("style", EMPTY_STRING).equals("BADGE_STYLE_TYPE_LIVE_NOW") ||
badgeRenderer.getString("label", EMPTY_STRING).equals("LIVE NOW")) {
return cachedStreamType = StreamType.LIVE_STREAM;
}
}