您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Watch age-restricted YouTube videos without login or age verification 😎 with enhanced features!
当前为
// ==UserScript== // @name Advanced YouTube Age Restriction Bypass Pro // @description Watch age-restricted YouTube videos without login or age verification 😎 with enhanced features! // @version 4.2.0 // @author Zerody (Enhanced by Cody) // @namespace https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/ // @supportURL https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/issues // @license MIT // @match https://www.youtube.com/* // @match https://www.youtube-nocookie.com/* // @match https://m.youtube.com/* // @match https://music.youtube.com/* // @grant none // @run-at document-start // @compatible chrome // @compatible firefox // @compatible opera // @compatible edge // @compatible safari // ==/UserScript== (function () { 'use strict'; const CONFIG = { ENABLE_UNLOCK_NOTIFICATION: true, ENABLE_AUTO_AD_SKIPPER: true, DEFAULT_VIDEO_QUALITY: '1080p', ENABLE_ERROR_REPORTING: true, COUNTRY_SPECIFIC_PROXIES: { US: 'https://us-proxy.server.com', EU: 'https://eu-proxy.server.com', }, RATE_LIMIT_REQUESTS: 10, LOG_LEVEL: 'INFO', }; const UNLOCKABLE_STATUSES = ['AGE_VERIFICATION_REQUIRED', 'CONTENT_WARNING']; let activeObservers = []; const logger = { info: (msg) => logMessage('INFO', msg), warn: (msg) => logMessage('WARN', msg), error: (msg) => logMessage('ERROR', msg), }; function logMessage(level, msg) { if (['INFO', 'WARN', 'ERROR'].includes(level) && CONFIG.LOG_LEVEL === level) { console.log(`[YouTube Bypass Pro - ${level}]`, msg); } } function showNotification(message, timeout = 5000) { if (!CONFIG.ENABLE_UNLOCK_NOTIFICATION) return; const notification = document.createElement('div'); notification.textContent = message; Object.assign(notification.style, { position: 'fixed', bottom: '10px', right: '10px', backgroundColor: '#007BFF', color: '#FFF', padding: '10px', borderRadius: '5px', zIndex: 9999, fontSize: '14px', }); document.body.appendChild(notification); setTimeout(() => notification.remove(), timeout); } function getProxy(countryCode) { return CONFIG.COUNTRY_SPECIFIC_PROXIES[countryCode] || Object.values(CONFIG.COUNTRY_SPECIFIC_PROXIES)[0]; } async function unlockResponse(response) { try { if (response.playabilityStatus && UNLOCKABLE_STATUSES.includes(response.playabilityStatus.status)) { showNotification('Unlocking video...'); const proxy = getProxy('US'); const unlockAttempt = await fetch(`${proxy}/unlock`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ videoId: response.videoDetails.videoId }), }); const unlockedData = await unlockAttempt.json(); if (unlockedData.errorMessage) throw new Error(unlockedData.errorMessage); Object.assign(response, unlockedData); logger.info('Video unlocked successfully.'); showNotification('Video unlocked successfully!'); } } catch (error) { logger.warn(`Unlock failed: ${error.message}`); showNotification('Video unlock failed. Retrying...'); } } const nativeXHROpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (method, url, ...args) { if (url.includes('/youtubei/v1/player')) { this.addEventListener('readystatechange', function () { if (this.readyState === 4 && this.status === 200) { try { const response = JSON.parse(this.responseText); unlockResponse(response); this.responseText = JSON.stringify(response); } catch (error) { logger.error(`Error modifying video response: ${error.message}`); } } }); } nativeXHROpen.call(this, method, url, ...args); }; function enableAdSkipper() { if (!CONFIG.ENABLE_AUTO_AD_SKIPPER) return; const observer = new MutationObserver(() => { const skipButton = document.querySelector('.ytp-ad-skip-button'); if (skipButton) { skipButton.click(); logger.info('Skipped an ad.'); } }); observer.observe(document.body, { childList: true, subtree: true }); activeObservers.push(observer); } function setVideoQuality() { const observer = new MutationObserver(() => { const settingsButton = document.querySelector('.ytp-settings-button'); if (settingsButton) { settingsButton.click(); observer.disconnect(); setTimeout(() => { const qualityOption = [...document.querySelectorAll('.ytp-menuitem')].find((item) => item.textContent.includes(CONFIG.DEFAULT_VIDEO_QUALITY) ); if (qualityOption) qualityOption.click(); logger.info(`Set video quality to ${CONFIG.DEFAULT_VIDEO_QUALITY}`); }, 200); } }); observer.observe(document.body, { childList: true, subtree: true }); activeObservers.push(observer); } function disconnectObservers() { activeObservers.forEach((observer) => observer.disconnect()); activeObservers = []; } function init() { logger.info('Initializing YouTube Age Bypass...'); enableAdSkipper(); setVideoQuality(); window.addEventListener('beforeunload', disconnectObservers); logger.info('Initialization complete!'); } init(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址