mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-11-19 02:19:23 +01:00
chore(YouTube - Client spoof): add logging. fix fall over logic if android client call fails
This commit is contained in:
parent
09e8b3e345
commit
ab9989d41f
@ -50,9 +50,6 @@ public class SpoofSignaturePatch {
|
||||
|
||||
private static volatile Future<StoryboardRenderer> rendererFuture;
|
||||
|
||||
@Nullable
|
||||
private static volatile StoryboardRenderer renderer;
|
||||
|
||||
@Nullable
|
||||
private static StoryboardRenderer getRenderer() {
|
||||
if (rendererFuture != null) {
|
||||
|
@ -63,9 +63,8 @@ public class StoryboardRendererRequester {
|
||||
@Nullable
|
||||
private static StoryboardRenderer getStoryboardRendererUsingBody(@NonNull String innerTubeBody) {
|
||||
final JSONObject playerResponse = fetchPlayerResponse(innerTubeBody);
|
||||
Objects.requireNonNull(playerResponse);
|
||||
|
||||
if (isPlayabilityStatusOk(playerResponse)) return getStoryboardRendererUsingResponse(playerResponse);
|
||||
if (playerResponse != null && isPlayabilityStatusOk(playerResponse))
|
||||
return getStoryboardRendererUsingResponse(playerResponse);
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -100,8 +99,13 @@ public class StoryboardRendererRequester {
|
||||
Objects.requireNonNull(videoId);
|
||||
|
||||
var renderer = getStoryboardRendererUsingBody(String.format(ANDROID_INNER_TUBE_BODY, videoId));
|
||||
if (renderer == null)
|
||||
if (renderer == null) {
|
||||
LogHelper.printDebug(() -> videoId + " not available using android client");
|
||||
renderer = getStoryboardRendererUsingBody(String.format(TV_EMBED_INNER_TUBE_BODY, videoId, videoId));
|
||||
if (renderer == null) {
|
||||
LogHelper.printDebug(() -> videoId + " not available using tv embedded client");
|
||||
}
|
||||
}
|
||||
|
||||
return renderer;
|
||||
} catch (Exception ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user