From 361f142621b167bd033548d5c5f67804f44a561f Mon Sep 17 00:00:00 2001 From: bopol Date: Wed, 23 Jun 2021 11:25:59 +0200 Subject: [PATCH] Use badge style instead of label --- .../youtube/extractors/YoutubeStreamInfoItemExtractor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java index 4183fc0a2d..f7cd38d946 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java @@ -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; } }