您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Força o modo DVR em transmissões ao vivo no YouTube com DVR desativado
// ==UserScript== // @name Unlock YT Live Rewind // @namespace custom.scripts.youtube // @version 1.0.0 // @description Força o modo DVR em transmissões ao vivo no YouTube com DVR desativado // @author CustomDev // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start // @grant none // @license MIT // ==/UserScript== (() => { 'use strict'; // Acesso indireto ao getter/setter original de playerResponse const originalDescriptor = Object.getOwnPropertyDescriptor(Object.prototype, 'playerResponse'); const originalGet = originalDescriptor?.get?.bind(Object.prototype) ?? function () { return this.__rewindPatch__; }; const originalSet = originalDescriptor?.set?.bind(Object.prototype) ?? function (val) { this.__rewindPatch__ = val; }; function isPlainObject(val) { return val && typeof val === 'object'; } Object.defineProperty(Object.prototype, 'playerResponse', { configurable: true, get() { return originalGet.call(this); }, set(newData) { if (!isPlainObject(newData)) { return originalSet.call(this, newData); } const video = newData.videoDetails; const stream = newData.streamingData; const config = newData.playerConfig; if (isPlainObject(video) && video.isLive && !video.isLiveDvrEnabled) { video.isLiveDvrEnabled = true; if (isPlainObject(config) && isPlainObject(config.mediaCommonConfig)) { config.mediaCommonConfig.useServerDrivenAbr = false; } if (isPlainObject(stream) && stream.serverAbrStreamingUrl) { delete stream.serverAbrStreamingUrl; } } originalSet.call(this, newData); } }); })();