Skip to content

Commit

Permalink
fix(YouTube - Client spoof): Display seekbar thumbnails in high quality
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Sep 25, 2023
1 parent b76794b commit f71c1a0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class SpoofSignaturePatch {
private static boolean isPlayingShorts;

private static String storyboardRendererSpec = "";
private static int recommendedLevel;

/**
* Injection point.
Expand Down Expand Up @@ -82,17 +83,30 @@ public static boolean getSeekbarThumbnailOverrideValue() {
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public static void fetchStoryboardsRenderer(@NonNull String videoId) {
final String storyboardsRendererSpec = storyboardsRenderer.getString("spec");

SpoofSignaturePatch.setStoryboardRendererSpec(storyboardsRendererSpec);
SpoofSignaturePatch.setRecommendedLevel(storyboardsRenderer.getInt("recommendedLevel"));

LogHelper.printDebug(() -> "StoryBoard renderer spec: " + storyboardsRendererSpec);

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f71c1a0

Please sign in to comment.