Skip to content

Commit

Permalink
first fix Amazon.com ad
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 27, 2024
1 parent 02aab31 commit 0057ad4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AuthorHours.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"time":"480h16m32s"}
{"time":"480h34m56s"}
6 changes: 4 additions & 2 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1097,15 +1097,17 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
async function skipAd(video) {
// Series grimm
const adTimeText = document.querySelector(".atvwebplayersdk-ad-timer-text");
if (adTimeText) {
if (adTimeText?.checkVisibility()) {
let adTime;
adTime = parseAdTime(adTimeText?.childNodes?.[0]?.textContent);
if (!adTime) adTime = parseAdTime(adTimeText?.childNodes?.[1]?.textContent);
// !document.querySelector(".fu4rd6c.f1cw2swo") so it doesn't try to skip when the self ad is playing
if (!document.querySelector(".fu4rd6c.f1cw2swo") && adTime > 1 && !lastAdTimeText) {
lastAdTimeText = adTime;
resetLastATimeText();
const skipTime = adTime - 1;
// biggest skiptime before crashing on amazon.com, can be little higher than 90 but 90 to be safe
const bigTime = 90;
const skipTime = adTime > bigTime ? bigTime : adTime - 1;
video.currentTime += skipTime;
log("FreeVee Ad skipped, length:", skipTime, "s");
settings.Statistics.AmazonAdTimeSkipped += skipTime;
Expand Down

0 comments on commit 0057ad4

Please sign in to comment.