Last active
October 3, 2021 22:03
-
-
Save happiness801/40538678d436299f8026cd6ba2848de3 to your computer and use it in GitHub Desktop.
Remove Cruft from Sports24 Video Streaming
This file contains 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 Sports24 Cruft | |
// @namespace http://onai.net/ | |
// @version 0.7 | |
// @description Remove cruft from Sports24 video streaming | |
// @author Kevin Gwynn | |
// @match https://sports24.club/*/**/*.html | |
// @match https://sports24.stream/*/**/*.html | |
// @match https://sports24.club/**/*.html | |
// @match https://sports24.stream/**/*.html | |
// @match https://sports24.club/*/*.php* | |
// @match https://sports24.stream/*/*.php* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
// Make sure jQuery is available | |
var gen = 0;var act=function(){gen=1;var script=document.createElement('script');script.src='//code.jquery.com/jquery-1.11.0.min.js';script.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(script);};(!window.jQuery)?act():1;setTimeout(function(){console.log('jQuery '+(gen?'loaded: ':'existing: ')+(window.jQuery?jQuery().jquery:'no jQuery/load failed'));}, 500); | |
if (window.top === window.self) { | |
console.log('Script running on TOP... not in iFrame'); | |
} else { | |
console.log('Script running in frame.'); | |
} | |
var removeCruft = function() { | |
console.log('KAG: Sports24 Cruft Cleanup...'); | |
let jQuery = $ || jQuery; | |
// Close chat | |
jQuery('#chat1').remove(); | |
// Remove some ads | |
jQuery('.btn-outline-primary').remove(); | |
// Remove iFrames except PPP (Player) | |
jQuery('iframe[id!=ppp]').remove(); | |
// Remove "gamecard" | |
jQuery('#gamecard').remove(); | |
// Remove top-nav | |
jQuery('nav').remove(); | |
// Remove footer and unnecessary BR's | |
jQuery('footer,br').remove(); | |
// Remove "rows" except player row | |
jQuery('div.row[id!=playRow]').remove(); | |
// Remove "adsbymahimeta" | |
jQuery('.adsbymahimeta').remove(); | |
// Remove "footy" | |
jQuery('#footylight_sports24_large,#footylight_sports24_small').remove(); | |
// Remove "custom banner" | |
jQuery('#id-custom_banner').remove(); | |
// Do what clicking the close button on another overlay does... | |
if (typeof window.closebutton === 'function') | |
window.closebutton( false ); | |
// Other cleanup (player) | |
jQuery('.adrespl').remove(); | |
jQuery('.embed-responsive').attr('style', ''); | |
jQuery('.container').attr('style', 'padding:0;width:100%;margin:0;max-width:100%;'); | |
// Remove "Buy me a coffee" | |
jQuery('#bmc-wbtn').remove(); | |
// Close video overlay cruft | |
jQuery('img[src="/images/close.jpg"]').click(); | |
} | |
var startVideo = function() { | |
console.log('KAG: Play.'); | |
// Click Play | |
jQuery('.bmpui-ui-playbacktogglebutton').click(); | |
// Click Fullscreen | |
jQuery('.bmpui-ui-fullscreentogglebutton').click(); | |
} | |
removeCruft(); | |
setTimeout(removeCruft, 3000); | |
setTimeout(removeCruft, 5000); | |
setTimeout(startVideo, 3000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment