您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Tools for youtube, these tools let you modify the likes, video title, subscribers and views of the vid, dm me on dc if you want me to add ur idea
当前为
// ==UserScript== // @name Ans youtube GUI (ADBLOCKER, VOLUME CHANGER, 15+ MODS) // @name:fi Anin Youtube käyttöliittymä (MAINOSESTÄJÄ, ÄÄNITASON VAIHTAJA, 15+ MODIFIKAATIOTA) // @namespace http://tampermonkey.net/ // @version 1.0.9 // @description Tools for youtube, these tools let you modify the likes, video title, subscribers and views of the vid, dm me on dc if you want me to add ur idea // @description:fi Työkaluja youtubeen nämä työkalut antaa sinun modifioida tykkäyksiä, videon nimeä, tilaajia ja videon katselukertoja, lähetä viestiä discordissa jos haluat että minä lisään ideasi. // @author @theyhoppingonme on discord // @match https://www.youtube.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // ==/UserScript== (function() { 'use strict'; //patch logs: // V1.0.0: GUI released // V1.0.1: Adblock // V1.0.2: Just a simple name change and patch logs // V1.0.3 Added more unsubscribe button filters // V1.0.4 New GUI name // V1.0.5 Added desc changer // V1.0.6 Added pinned comment name changer // V1.0.7 Added volume changer (bass boost epic), video width changer, video height changer, video duration changer, video time watched changer // V1.0.8 Ad block has been fixed and enhanced as well as the unsubscribing, before you had to unsubscribe first manually but now its fully functional! // V1.0.9 Adblock is ACTUALLY fixed sorry for the inconvinience it was broken a bit function isYouTubeShort() { const currentURL = window.location.href; if (currentURL.includes('youtube.com/shorts/')) { console.log('Mostly everything is bugged on shorts, if you wish to use the script on this video, go and watch the non-short version.'); } } isYouTubeShort(); function isLiveChat() { const currentURL = window.location.href; if (currentURL.includes('youtube.com/live_chat')) { return; } } isLiveChat(); const style = document.createElement('style'); // style for the menu style.textContent = ` .container { text-align: center; width: 90%; max-width: 800px; padding: 30px; background-color: #333; border-radius: 15px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); font-family: 'Arial', sans-serif; color: white; position: fixed; top: 10px; right: 10px; z-index: 10000; } button:hover { background-color: #6B3EFF; } .close-button, .minimize-button { position: absolute; top: 10px; background-color: transparent; border: none; color: white; font-size: 20px; cursor: pointer; } .close-button { right: 30px; } .minimize-button { right: 70px; } `; document.head.appendChild(style); const container = document.createElement('div'); //Creating the menu container.className = 'container'; document.body.appendChild(container); const title = document.createElement('h1'); // menu name const nameElement = document.getElementById("account-name"); const name = nameElement ? nameElement.textContent.trim() : "Guest"; title.textContent = "Ans Youtube GUI V1.0.9"; container.appendChild(title); const closeButton = document.createElement('button'); // close button closeButton.className = 'close-button'; closeButton.textContent = 'X'; container.appendChild(closeButton); closeButton.addEventListener('click', () => { container.style.display = 'none'; }); // minimize menu (button not shown, press insert to minimize) const minimizeButton = document.createElement('button'); minimizeButton.className = 'minimize-button'; minimizeButton.textContent = ''; container.appendChild(minimizeButton); minimizeButton.addEventListener('click', () => { container.style.display = 'none'; }); const inputs = [ // inputs { placeholder: 'Fake likes', action: setFakeLikes }, { placeholder: 'Fake subs', action: setFakeSubs }, { placeholder: 'Fake views', action: setFakeViews }, { placeholder: 'Change Title', action: setChangeTitle }, { placeholder: 'Change ChannelName', action: setFakeName }, { placeholder: 'Change Playbackspeed', action: setPlaybackSpeed }, { placeholder: 'Fake Description', action: setDesc }, { placeholder: 'Fake CommentPinner', action: setPinner }, { placeholder: 'Change volume', action: setVolume }, { placeholder: 'Video Height', action: setHeight }, { placeholder: 'Video Width', action: setWidth }, { placeholder: 'Video Duration', action: setDuration }, { placeholder: 'Set TimeWatched (seconds)', action: setTime } ]; function createInputButton(inputConfig) { // creating input buttons const input = document.createElement('input'); input.type = 'text'; input.placeholder = inputConfig.placeholder; container.appendChild(input); const button = document.createElement('button'); button.textContent = `Set ${inputConfig.placeholder.split(' ')[1]}`; container.appendChild(button); button.addEventListener('click', () => { inputConfig.action(input.value); }); } function createToggleButton(label, enableFunction, disableFunction) { // creating toggles const toggleContainer = document.createElement('div'); toggleContainer.style.marginTop = '10px'; container.appendChild(toggleContainer); const labelElement = document.createElement('span'); labelElement.textContent = label; labelElement.style.marginRight = '10px'; toggleContainer.appendChild(labelElement); const toggleButton = document.createElement('button'); toggleButton.textContent = 'OFF'; toggleButton.style.padding = '5px 10px'; toggleButton.style.cursor = 'pointer'; toggleContainer.appendChild(toggleButton); let isToggled = false; toggleButton.addEventListener('click', () => { isToggled = !isToggled; toggleButton.textContent = isToggled ? 'ON' : 'OFF'; toggleButton.style.backgroundColor = isToggled ? '#6B3EFF' : ''; if (isToggled) { enableFunction(); } else { disableFunction(); } }); } const Adblock = () => { const adSelectors = [ '.ytp-ad-module', '.ytp-ad-text', '.ad-interrupting', '.video-ads', '.ytp-ad-image-overlay' ]; const links = [ 'about:blank' ]; const skipButton = document.querySelector('.ytp-ad-skip-button'); if (skipButton) skipButton.click(); adSelectors.forEach(selector => { document.querySelectorAll(selector).forEach(ad => { ad.currentTime = ad.duration; }); }); }; const reenableAds = () => { const skipButton = document.querySelector('.ytp-ad-skip-button'); if (skipButton) skipButton.style.display = 'block'; const overlayAd = document.querySelector('.ytp-ad-overlay-slot'); if (overlayAd) overlayAd.style.display = 'block'; const bannerAd = document.querySelector('.ytp-ce-element'); if (bannerAd) bannerAd.style.display = 'block'; const adFrame = document.querySelector('iframe[src*="ads"]'); if (adFrame) adFrame.style.display = 'block'; const adSelectors = [ '.ytp-ad-player-overlay', '.ytp-ad-module', '.ytp-ad-text', '.ad-interrupting', '.video-ads', '.ytp-ad-image-overlay' ]; adSelectors.forEach(selector => { document.querySelectorAll(selector).forEach(ad => { ad.style.display = 'block'; }); }); const originalFetch = window.fetch; window.fetch = originalFetch; const originalXhrOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = originalXhrOpen; }; createToggleButton('Toggle YouTube Ad Blocker', Adblock, reenableAds); // ad block createToggleButton('Toggle Mute', // mute button, emulates the M key press () => { const keyEvent = new KeyboardEvent('keydown', { key: 'm', code: 'KeyM', keyCode: 77, which: 77, bubbles: true, cancelable: true }); document.dispatchEvent(keyEvent); }, () => { const keyEvent = new KeyboardEvent('keydown', { key: 'm', code: 'KeyM', keyCode: 77, which: 77, bubbles: true, cancelable: true }); document.dispatchEvent(keyEvent); } ); createToggleButton( 'Toggle subscription', () => { const subscribeButton = document.querySelector('.yt-spec-button-shape-next.yt-spec-button-shape-next--filled.yt-spec-button-shape-next--mono.yt-spec-button-shape-next--size-m'); if (subscribeButton) { const clickEvent = new MouseEvent('click', { bubbles: true, cancelable: true, view: window }); subscribeButton.dispatchEvent(clickEvent); } else { console.error('Subscribe button not found'); } }, () => { const unsubscribeButton = document.querySelector( 'button[aria-label="Unsubscribe"].yt-spec-button-shape-next.yt-spec-button-shape-next--text.yt-spec-button-shape-next--call-to-action.yt-spec-button-shape-next--size-m' ); if (unsubscribeButton) { const clickEvent = new MouseEvent('click', { bubbles: true, cancelable: true, view: window }); unsubscribeButton.dispatchEvent(clickEvent); } else { console.error('Unsubscribe button not found, creating it...'); const button = document.querySelector( 'button.yt-spec-button-shape-next.yt-spec-button-shape-next--tonal.yt-spec-button-shape-next--mono.yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-leading-trailing' ); button.click(); const observerz = new MutationObserver((mutationsList) => { mutationsList.forEach((mutation) => { mutation.addedNodes.forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE && node.textContent === 'Unsubscribe') { node.click(); observerz.disconnect(); } }); }); }); observerz.observe(document.body, { childList: true, subtree: true }); console.log("Step 1 success!"); function wait50ms() { return new Promise(resolve => setTimeout(resolve, 50)); } wait50ms().then(() => { const cancelButton = document.querySelector( 'button.yt-spec-button-shape-next.yt-spec-button-shape-next--text.yt-spec-button-shape-next--mono.yt-spec-button-shape-next--size-m[aria-label="Cancel"]' ); if (cancelButton) { cancelButton.click(); console.log("Unsubscribe button created!"); if (unsubscribeButton) { const clickEvent = new MouseEvent('click', { bubbles: true, cancelable: true, view: window }); unsubscribeButton.dispatchEvent(clickEvent); } else { console.error('Failed to find unsubscribe button after cancel.'); } } }); } } ); createToggleButton('Paused', // pausing, self explainitory () => { const video = document.querySelector('video'); video.pause(); }, () => { const video = document.querySelector('video'); video.play(); } ); // fake likes, reminder do not change the likes first letter to be a character, it breaks the script function setFakeLikes(value) { const likesElement = document.querySelectorAll('div[class="yt-spec-button-shape-next__button-text-content"]'); likesElement.forEach(element => { const textContent = element.textContent.trim(); if (textContent && !isNaN(textContent[0])) { element.textContent = value; } }); } // playbackspeed function setPlaybackSpeed(value) { const video = document.querySelector("video"); video.playbackRate = value; } // set volume let audioContext; let gainNode; function setVolume(value) { const video = document.querySelector("video"); if (!audioContext) { audioContext = new AudioContext(); } if (!gainNode) { gainNode = audioContext.createGain(); const source = audioContext.createMediaElementSource(video); source.connect(gainNode); gainNode.connect(audioContext.destination); } gainNode.gain.value = value; } // desc function setDesc(value) { const Desc = document.querySelector( 'span.yt-core-attributed-string.yt-core-attributed-string--white-space-pre-wrap[dir="auto"] > span.yt-core-attributed-string--link-inherit-color.yt-core-attributed-string--strikethrough.yt-core-attributed-string--line-style-single[dir="auto"][style="color: rgb(19, 19, 19);"]' ); Desc.textContent = value; } //fake subs function setFakeSubs(value) { const subsElement = document.getElementById('owner-sub-count'); if (subsElement) subsElement.textContent = value; } //fake pin function setPinner(value) { const pinner = document.querySelector('yt-formatted-string#label.style-scope.ytd-pinned-comment-badge-renderer'); if (pinner && pinner.id === 'label') { pinner.textContent = value; } else { console.log('404'); } } // fake views function setFakeViews(value) { const viewsElement = document.getElementsByClassName('style-scope yt-formatted-string bold'); if (viewsElement) viewsElement[0].textContent = value; } // width function setWidth(value) { const width = document.querySelector("video"); width.videoWidth = value; } //height function setHeight(value) { const height = document.querySelector("video"); height.videoHeight = value; } //duration function setDuration(value) { const duration = document.getElementsByClassName("ytp-time-duration"); const duration2 = document.querySelector('span[class="ytp-time-duration"]') duration.value = value; duration.textContent = value; duration2.textContent = value; } //Time watched function setTime(value) { const time = document.querySelector("video"); time.currentTime = value; } //fake name function setFakeName(value) { const nameElement = document.querySelector('a.yt-simple-endpoint.style-scope.yt-formatted-string[spellcheck="false"]'); if (nameElement) { nameElement.textContent = value; } else { console.log("Element not found"); } } // title changer function setChangeTitle(value) { const titleElement = document.querySelector('h1.style-scope.ytd-watch-metadata yt-formatted-string'); if (titleElement) { titleElement.textContent = value; } } inputs.forEach(createInputButton); // dragging script let isDragging = false; let offsetX, offsetY; // minimizing container.addEventListener('mousedown', (e) => { if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'BUTTON') { isDragging = true; offsetX = e.clientX - container.getBoundingClientRect().left; offsetY = e.clientY - container.getBoundingClientRect().top; } }); document.addEventListener('mousemove', (e) => { if (isDragging) { container.style.left = `${e.clientX - offsetX}px`; container.style.top = `${e.clientY - offsetY}px`; } }); document.addEventListener('mouseup', () => { isDragging = false; }); let isVisible = true; document.addEventListener('keydown', (e) => { if (e.key === 'Insert') { if (isVisible) { container.style.display = 'none'; } else { container.style.display = 'block'; } isVisible = !isVisible; } }); // made by theyhoppingonme on discord })();