[YouTube] Detect LIVE videos in the trending page

This commit is contained in:
Mauricio Colli 2020-03-07 16:42:00 -03:00
parent 6446abc6d1
commit 1ef706f567
No known key found for this signature in database
GPG Key ID: F200BFD6F29DDD85

View File

@ -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;
}