feat(mobile): auto-accept age-gate modal in WebView fallback

4k69 (and similar) show an "Are you 18 or above? Yes/No" modal that blocks the jwplayer
from initialising, so the WebView fallback never extracts a stream. Click the age-gate
accept button by id (#pop_up_18_yes and id*=18_yes/age_yes variants) on the same loop as
the consent/play-poster auto-clickers. Verified on emulator: 4k69 age-gate clears and the
player initialises (ExoPlayer hands off). A VAST preroll is still grabbed instead of the
okcdn content for 4k69 specifically (report 5de3fbc5 stays open) - separate ad-filter work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jtrzupek 2026-06-14 11:31:12 +02:00
parent 08410fddd1
commit 2a9445fe4a

View file

@ -1010,14 +1010,24 @@ const INJECTED_JS = `
} }
}; };
// Age-gate auto-accept: 4k69 ma modal "Are you 18 or above?" z przyciskiem
// \`#pop_up_18_yes\`, który blokuje init jwplayera → INJECTED_JS nie wyłuska
// streamu (report 5de3fbc5). Klik precyzyjnie po id — jednoznaczne, bezpieczne.
const dismissAgeGate = function() {
const btn = document.querySelector('#pop_up_18_yes, [id*="18_yes"], [id*="age_yes"], [id*="ageyes"]');
if (btn) { try { btn.click(); } catch (e) {} }
};
setInterval(function() { setInterval(function() {
removeAdIframes(); removeAdIframes();
dismissConsent(); dismissConsent();
dismissAgeGate();
clickPlayPoster(); clickPlayPoster();
}, 1000); }, 1000);
// Pierwsza próba consent natychmiast (banner bywa w SSR HTML) — bez czekania // Pierwsza próba consent/age-gate natychmiast (modal bywa w SSR HTML) — bez czekania
// na pierwszy tick interwału. // na pierwszy tick interwału.
dismissConsent(); dismissConsent();
dismissAgeGate();
// -- 2. Auto-extract m3u8/mp4 ----------------------------------------------- // -- 2. Auto-extract m3u8/mp4 -----------------------------------------------
const VIDEO_RE = /https?:\\/\\/[^"'\\s<>]+\\.(?:m3u8|mp4|mpd)(?:\\?[^"'\\s<>]*)?/i; const VIDEO_RE = /https?:\\/\\/[^"'\\s<>]+\\.(?:m3u8|mp4|mpd)(?:\\?[^"'\\s<>]*)?/i;