From 1ef706f5672ac7790601ee407362b574c7e35e03 Mon Sep 17 00:00:00 2001 From: Mauricio Colli Date: Sat, 7 Mar 2020 16:42:00 -0300 Subject: [PATCH] [YouTube] Detect LIVE videos in the trending page --- .../extractors/YoutubeStreamInfoItemExtractor.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 8725e5542..00aa8ae2b 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,6 +63,15 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor { } } catch (Exception ignored) {} + + try { + final String style = videoInfo.getArray("thumbnailOverlays").getObject(0) + .getObject("thumbnailOverlayTimeStatusRenderer").getString("style"); + if (style.equalsIgnoreCase("LIVE")) { + return StreamType.LIVE_STREAM; + } + } catch (Exception ignored) {} + return StreamType.VIDEO_STREAM; }