fix(YouTube - Spoof video streams): Make livestreams start at the current time when using iOS client (#4137)

This commit is contained in:
LisoUseInAIKyrios
2024-12-16 22:43:50 +04:00
committed by GitHub
parent 1150babf87
commit 140f484b4b
4 changed files with 38 additions and 1 deletions

View File

@ -16,6 +16,10 @@ import app.revanced.extension.shared.spoof.requests.StreamingDataRequest;
@SuppressWarnings("unused")
public class SpoofVideoStreamsPatch {
private static final boolean SPOOF_STREAMING_DATA = BaseSettings.SPOOF_VIDEO_STREAMS.get();
private static final boolean FIX_HLS_CURRENT_TIME = SPOOF_STREAMING_DATA
&& BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get() == ClientType.IOS;
/**
* Any unreachable ip address. Used to intentionally fail requests.
*/
@ -165,6 +169,19 @@ public class SpoofVideoStreamsPatch {
return postData;
}
/**
* Injection point.
*
* Fixes iOS livestreams starting from the beginning.
*/
public static boolean fixHLSCurrentTime(boolean original) {
if (FIX_HLS_CURRENT_TIME) {
return false;
}
return original;
}
public static final class SpoofiOSAvailability implements Setting.Availability {
@Override
public boolean isAvailable() {