-
-
Save ngi/99134b4bc1f97ff87a7fa8be3b573514 to your computer and use it in GitHub Desktop.
Video Bypass (maxs19.fun, maxstream.video)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Video Bypass (maxstream generic) | |
| // @version 2.0.3 | |
| // @description Bypasses Anti-AdBlock on maxstream-like streaming sites. On /watchfree/* pages, extracts the real video URL from iframes and redirects. On other pages, blocks alert/confirm/prompt dialogs. | |
| // @author antwal, ngi | |
| // @license MIT | |
| // @match https://*.maxstream.video/* | |
| // @match https://*/*watchfree/* | |
| // @match https://*/*freewatcher/* | |
| // @match https://*/*freeswatcee/* | |
| // @grant none | |
| // @run-at document-start | |
| // @downloadURL https://gist.github.com/ngi/99134b4bc1f97ff87a7fa8be3b573514/raw/maxstream-video-bypass.user.js | |
| // @updateURL https://gist.github.com/ngi/99134b4bc1f97ff87a7fa8be3b573514/raw/maxstream-video-bypass.user.js | |
| // @homepage https://gist.github.com/ngi/99134b4bc1f97ff87a7fa8be3b573514 | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| // Path patterns for pages embedding the maxstream.video iframe | |
| const WATCH_PATH_PATTERNS = [ | |
| /^\/watchfree\//, | |
| /^\/freewatcher\//, | |
| /^\/freeswatcee\//, | |
| ]; | |
| function isWatchfreeUrl() { | |
| return WATCH_PATH_PATTERNS.some(pattern => pattern.test(window.location.pathname)); | |
| } | |
| // Generic pattern to recognize maxstream-like domains | |
| const DOMAIN_PATTERNS = [ | |
| /max\w*\d*\.\w+$/,// maxs19.fun, maxmon23.online, maxv.lol, etc. | |
| /maxstream\.video$/, | |
| /fmax\d*\.\w+$/, | |
| /sumax\d*\.\w+$/, | |
| /samax\d*\.\w+$/, | |
| ]; | |
| function isKnownDomain(hostname) { | |
| return DOMAIN_PATTERNS.some(pattern => pattern.test(hostname)); | |
| } | |
| if (!isKnownDomain(window.location.hostname)) return; | |
| if (isWatchfreeUrl()) { | |
| const iframes = document.getElementsByTagName("iframe"); | |
| for (let i = 0; i < iframes.length; i++) { | |
| const src = iframes[i].getAttribute("src") || iframes[i].src; | |
| if (src && src.includes("maxstream.video")) { | |
| window.location.replace(src); | |
| return; | |
| } | |
| } | |
| const observer = new MutationObserver((mutations) => { | |
| for (const mutation of mutations) { | |
| for (const node of mutation.addedNodes) { | |
| if (node.tagName === "IFRAME") { | |
| const src = node.getAttribute("src") || node.src; | |
| if (src && src.includes("maxstream.video")) { | |
| observer.disconnect(); | |
| window.location.replace(src); | |
| return; | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| observer.observe(document.body || document.documentElement, { | |
| childList: true, | |
| subtree: true | |
| }); | |
| } else { | |
| Object.defineProperty(window, 'alert', { | |
| value: function(message) { | |
| console.log("Blocked alert: " + message); | |
| }, | |
| writable: false, | |
| configurable: false | |
| }); | |
| Object.defineProperty(window, 'confirm', { | |
| value: function(message) { | |
| console.log("Blocked confirm: " + message); | |
| return true; | |
| }, | |
| writable: false, | |
| configurable: false | |
| }); | |
| Object.defineProperty(window, 'prompt', { | |
| value: function(message) { | |
| console.log("Blocked prompt: " + message); | |
| return null; | |
| }, | |
| writable: false, | |
| configurable: false | |
| }); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated script