Skip to content

Commit ec1e6d6

Browse files
committed
Add protection against server-side ad injection (SSAP)
1 parent 5c10e07 commit ec1e6d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/routes/postSkipSegments.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ async function autoModerateSubmission(apiVideoDetails: videoDetails,
129129
// return false on undefined or 0
130130
if (!duration) return false;
131131

132+
if (apiDuration && apiDuration > 2 && duration && duration > 2 && Math.abs(apiDuration - duration) > 3) {
133+
// YouTube server-side ad injection might be active, reject
134+
return "YouTube is currently testing a new anti-adblock technique called server-side ad-injection. This causes skips and submissions to be offset by the duration of the ad. It seems that you are affected by this A/B test, so until a fix is developed, we cannot accept submissions from your device due to them potentially being inaccurate.";
135+
}
136+
132137
const segments = submission.segments;
133138
// map all times to float array
134139
const allSegmentTimes = segments.filter((s) => s.actionType !== ActionType.Chapter)

0 commit comments

Comments
 (0)