Revert "[YouTube] Fix getting stream type of live streams"
This commit is contained in:
parent
598de2dd5f
commit
c998012c28
1 changed files with 6 additions and 11 deletions
|
@ -62,22 +62,17 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
||||||
}
|
}
|
||||||
|
|
||||||
final JsonArray badges = videoInfo.getArray("badges");
|
final JsonArray badges = videoInfo.getArray("badges");
|
||||||
for (final Object badge : badges) {
|
for (Object badge : badges) {
|
||||||
if (((JsonObject) badge).getObject("metadataBadgeRenderer")
|
if (((JsonObject) badge).getObject("metadataBadgeRenderer").getString("label", EMPTY_STRING).equals("LIVE NOW")) {
|
||||||
.getString("label", EMPTY_STRING).equals("LIVE NOW")) {
|
|
||||||
return cachedStreamType = StreamType.LIVE_STREAM;
|
return cachedStreamType = StreamType.LIVE_STREAM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final JsonArray thumbnailOverlays = videoInfo.getArray("thumbnailOverlays");
|
final String style = videoInfo.getArray("thumbnailOverlays").getObject(0)
|
||||||
for (final Object object : thumbnailOverlays) {
|
.getObject("thumbnailOverlayTimeStatusRenderer").getString("style", EMPTY_STRING);
|
||||||
final JsonObject thumbnailOverlay = (JsonObject) object;
|
if (style.equalsIgnoreCase("LIVE")) {
|
||||||
if (thumbnailOverlay.has("thumbnailOverlayNowPlayingRenderer")
|
|
||||||
|| thumbnailOverlay.getObject("thumbnailOverlayTimeStatusRenderer")
|
|
||||||
.getString("style", EMPTY_STRING).equalsIgnoreCase("LIVE")) {
|
|
||||||
return cachedStreamType = StreamType.LIVE_STREAM;
|
return cachedStreamType = StreamType.LIVE_STREAM;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return cachedStreamType = StreamType.VIDEO_STREAM;
|
return cachedStreamType = StreamType.VIDEO_STREAM;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue