您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Block all Twitch ads, automatically claim bonus points, auto join raids, inject BTTV emotes, and promote Discord server
当前为
// ==UserScript== // @name Twitch Turbo + // @namespace https://github.com/Brembo19 // @version 1.4 // @description Block all Twitch ads, automatically claim bonus points, auto join raids, inject BTTV emotes, and promote Discord server // @author Brembo19 // @match *://*.twitch.tv/* // @grant none // ==/UserScript== (function() { 'use strict'; const blockAdsInVideo = () => { const video = document.querySelector('video'); if (video && video.src.includes('ad_')) { video.src = ''; console.log('Ad blocked in video stream'); } }; const removeAdBanners = () => { const adSelectors = [ '[aria-label="Advertisement"]', '.ad-banner', '.ad-slot', '.tw-ad-container', '[data-ad="true"]', 'div[class*="ad-"]', 'div[class*="sponsored"]' ]; adSelectors.forEach(selector => { document.querySelectorAll(selector).forEach(ad => ad.remove()); }); console.log('Ad banners removed'); }; const observeDynamicContent = () => { const observer = new MutationObserver(mutations => { mutations.forEach(mutation => { if (mutation.type === 'childList') { removeAdBanners(); } }); }); observer.observe(document.body, { childList: true, subtree: true }); }; const autoClaimBonus = () => { let claiming = false; const observer = new MutationObserver(() => { const bonus = document.querySelector('.claimable-bonus__icon'); if (bonus && !claiming) { bonus.click(); claiming = true; console.log('Bonus claimed'); setTimeout(() => { claiming = false; }, Math.random() * 1000 + 1000); } }); observer.observe(document.body, { childList: true, subtree: true }); }; const autoJoinRaid = () => { const observer = new MutationObserver(() => { const raidButton = document.querySelector('button[data-test-selector="raid-banner__join-button"]'); if (raidButton) { raidButton.click(); console.log('Automatically joined the raid'); } }); observer.observe(document.body, { childList: true, subtree: true }); }; const injectBTTVEmotes = () => { const emoteURL = 'https://betterttv.com/emotes/popular'; const emoteContainer = document.createElement('div'); emoteContainer.id = 'bttv-emotes'; emoteContainer.style.position = 'fixed'; emoteContainer.style.bottom = '0'; emoteContainer.style.right = '0'; emoteContainer.style.backgroundColor = '#000'; emoteContainer.style.color = '#fff'; emoteContainer.style.padding = '10px'; emoteContainer.style.zIndex = '9999'; emoteContainer.style.maxHeight = '200px'; emoteContainer.style.overflowY = 'scroll'; emoteContainer.style.display = 'flex'; emoteContainer.style.flexWrap = 'wrap'; document.body.appendChild(emoteContainer); fetch(emoteURL) .then(response => response.json()) .then(data => { const emotes = data.emotes; emotes.forEach(emote => { const emoteImg = document.createElement('img'); emoteImg.src = `https://cdn.betterttv.net/emote/${emote.id}/1x`; emoteImg.style.width = '32px'; emoteImg.style.height = '32px'; emoteImg.style.margin = '5px'; emoteImg.title = emote.code; emoteContainer.appendChild(emoteImg); }); console.log('BTTV emotes injected'); }) .catch(error => console.error('Error fetching BTTV emotes:', error)); }; const injectDiscordAd = () => { const adContainer = document.createElement('div'); adContainer.id = 'discord-ad'; adContainer.style.position = 'fixed'; adContainer.style.top = '10px'; adContainer.style.right = '10px'; adContainer.style.backgroundColor = '#7289da'; adContainer.style.color = '#fff'; adContainer.style.padding = '10px'; adContainer.style.zIndex = '9999'; adContainer.style.borderRadius = '5px'; adContainer.style.boxShadow = '0px 0px 10px rgba(0, 0, 0, 0.5)'; adContainer.innerHTML = ` <div style="text-align: center;"> <p>Join our Discord Server!</p> <a href="https://discord.gg/Cwm8fwknKC" target="_blank" style="color: #fff; text-decoration: underline;"> Click here to join </a> </div> `; document.body.appendChild(adContainer); }; blockAdsInVideo(); removeAdBanners(); observeDynamicContent(); autoClaimBonus(); injectBTTVEmotes(); autoJoinRaid(); injectDiscordAd(); setInterval(blockAdsInVideo, 1000); setInterval(removeAdBanners, 2000); })();