Skip to content

Commit 1ef706f

Browse files
committed
[YouTube] Detect LIVE videos in the trending page
1 parent 6446abc commit 1ef706f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ public StreamType getStreamType() {
6363
}
6464

6565
} catch (Exception ignored) {}
66+
67+
try {
68+
final String style = videoInfo.getArray("thumbnailOverlays").getObject(0)
69+
.getObject("thumbnailOverlayTimeStatusRenderer").getString("style");
70+
if (style.equalsIgnoreCase("LIVE")) {
71+
return StreamType.LIVE_STREAM;
72+
}
73+
} catch (Exception ignored) {}
74+
6675
return StreamType.VIDEO_STREAM;
6776
}
6877

0 commit comments

Comments
 (0)