Skip to content

Commit

Permalink
Use badge style instead of label
Browse files Browse the repository at this point in the history
  • Loading branch information
B0pol committed Jun 23, 2021
1 parent 58f109d commit 361f142
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public StreamType getStreamType() {

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;
}
}
Expand Down

0 comments on commit 361f142

Please sign in to comment.