Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(YouTube/Spoof client): first video is always spoofed as a client …
Browse files Browse the repository at this point in the history
…of Shorts, Clips
  • Loading branch information
inotia00 authored and anddea committed Jun 11, 2024
1 parent 31578d0 commit 14c22a5
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import app.revanced.integrations.shared.utils.Logger;
import app.revanced.integrations.youtube.patches.misc.requests.PlayerRoutes.ClientType;
import app.revanced.integrations.youtube.settings.Settings;
import app.revanced.integrations.youtube.shared.PlayerType;

/**
* @noinspection ALL
Expand Down Expand Up @@ -232,7 +231,7 @@ public static String appendSpoofedClient(String videoFormat) {
*/
public static String setPlayerResponseVideoId(@NonNull String videoId, @Nullable String parameters, boolean isShortAndOpeningOrPlaying) {
if (SPOOF_CLIENT_ENABLED) {
isShortsOrClips = playerParameterIsClipsOrShorts(parameters);
isShortsOrClips = playerParameterIsClipsOrShorts(parameters, isShortAndOpeningOrPlaying);

if (!isShortsOrClips) {
fetchLiveStreamRenderer(videoId, Settings.SPOOF_CLIENT_GENERAL.get());
Expand All @@ -245,8 +244,8 @@ public static String setPlayerResponseVideoId(@NonNull String videoId, @Nullable
/**
* @return If the player parameters are for a Short or Clips.
*/
private static boolean playerParameterIsClipsOrShorts(@Nullable String playerParameter) {
if (PlayerType.getCurrent().isNoneOrHidden()) {
private static boolean playerParameterIsClipsOrShorts(@Nullable String playerParameter, boolean isShortAndOpeningOrPlaying) {
if (isShortAndOpeningOrPlaying) {
return true;
}

Expand Down

0 comments on commit 14c22a5

Please sign in to comment.