fix(YouTube - Client spoof): Display seekbar thumbnails in high quality

This commit is contained in:
oSumAtrIX 2023-09-25 23:50:41 +02:00
parent b76794b08c
commit f71c1a0c15
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
3 changed files with 22 additions and 6 deletions

View File

@ -40,6 +40,7 @@ public class SpoofSignaturePatch {
private static boolean isPlayingShorts;
private static String storyboardRendererSpec = "";
private static int recommendedLevel;
/**
* Injection point.
@ -82,17 +83,30 @@ public class SpoofSignaturePatch {
return SettingsEnum.SPOOF_SIGNATURE.getBoolean();
}
/**
* Injection point.
*/
public static String getStoryboardRendererSpec() {
public static String getStoryboardRendererSpec(String originalStoryboardRendererSpec) {
if (!SettingsEnum.SPOOF_SIGNATURE.getBoolean()) return originalStoryboardRendererSpec;
return storyboardRendererSpec;
}
public static void setStoryboardRendererSpec(String newlyLoadedStoryboardRendererSpec) {
if (storyboardRendererSpec.equals(newlyLoadedStoryboardRendererSpec))
return;
/**
* Injection point.
*/
public static int getRecommendedLevel(int originalLevel) {
if (!SettingsEnum.SPOOF_SIGNATURE.getBoolean()) return originalLevel;
return recommendedLevel;
}
public static void setStoryboardRendererSpec(String newlyLoadedStoryboardRendererSpec) {
storyboardRendererSpec = newlyLoadedStoryboardRendererSpec;
}
public static void setRecommendedLevel(int level) {
recommendedLevel = level;
}
}

View File

@ -53,6 +53,8 @@ public class StoryBoardRendererRequester {
final String storyboardsRendererSpec = storyboardsRenderer.getString("spec");
SpoofSignaturePatch.setStoryboardRendererSpec(storyboardsRendererSpec);
SpoofSignaturePatch.setRecommendedLevel(storyboardsRenderer.getInt("recommendedLevel"));
LogHelper.printDebug(() -> "StoryBoard renderer spec: " + storyboardsRendererSpec);
} else {

View File

@ -12,8 +12,8 @@ public final class StoryBoardRendererRoutes {
static final Route GET_STORYBOARD_SPEC = new Route(
Route.Method.POST,
"player" +
"?fields=storyboards.playerStoryboardSpecRenderer.spec," +
"storyboards.playerLiveStoryboardSpecRenderer.spec"
"?fields=storyboards.playerStoryboardSpecRenderer," +
"storyboards.playerLiveStoryboardSpecRenderer"
);
private StoryBoardRendererRoutes() {