mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 06:10:33 +05:30
Go through all badges when checking if a StreamInfoItem is a live stream
This commit is contained in:
parent
830b7d3dbd
commit
35252235b0
@ -55,9 +55,13 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
|||||||
@Override
|
@Override
|
||||||
public StreamType getStreamType() {
|
public StreamType getStreamType() {
|
||||||
try {
|
try {
|
||||||
if (videoInfo.getArray("badges").getObject(0).getObject("metadataBadgeRenderer").getString("label").equals("LIVE NOW")) {
|
JsonArray badges = videoInfo.getArray("badges");
|
||||||
|
for (Object badge : badges) {
|
||||||
|
if (((JsonObject) badge).getObject("metadataBadgeRenderer").getString("label").equals("LIVE NOW")) {
|
||||||
return StreamType.LIVE_STREAM;
|
return StreamType.LIVE_STREAM;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
return StreamType.VIDEO_STREAM;
|
return StreamType.VIDEO_STREAM;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user