From 2a9445fe4a97373942560739be24618029e10f5b Mon Sep 17 00:00:00 2001 From: jtrzupek Date: Sun, 14 Jun 2026 11:31:12 +0200 Subject: [PATCH] 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 --- mobile/src/screens/PlayerScreen.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mobile/src/screens/PlayerScreen.tsx b/mobile/src/screens/PlayerScreen.tsx index cffdb7c..d238e33 100644 --- a/mobile/src/screens/PlayerScreen.tsx +++ b/mobile/src/screens/PlayerScreen.tsx @@ -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() { removeAdIframes(); dismissConsent(); + dismissAgeGate(); clickPlayPoster(); }, 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. dismissConsent(); + dismissAgeGate(); // -- 2. Auto-extract m3u8/mp4 ----------------------------------------------- const VIDEO_RE = /https?:\\/\\/[^"'\\s<>]+\\.(?:m3u8|mp4|mpd)(?:\\?[^"'\\s<>]*)?/i;