fix(YouTube - Client spoof): fix toast shown if opening paid or age restricted video (#482)

This commit is contained in:
LisoUseInAIKyrios 2023-09-26 05:39:44 +04:00 committed by GitHub
parent 245265587a
commit e72b65b599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,11 @@ public class StoryBoardRendererRequester {
if (responseCode == 200) {
final JSONObject playerResponse = Requester.parseJSONObject(connection);
if (!playerResponse.has("storyboards")) {
// Video is age restricted or paid.
LogHelper.printDebug(() -> "Video has no public storyboard: " + videoId);
return null;
}
final JSONObject storyboards = playerResponse.getJSONObject("storyboards");
final String storyboardsRendererTag = storyboards.has("playerLiveStoryboardSpecRenderer")
? "playerLiveStoryboardSpecRenderer"