哔哩哔哩直播HEVC假原画屏蔽

通过伪装不支持HEVC来屏蔽哔哩哔哩直播的HEVC假原画

目前為 2023-02-08 提交的版本,檢視 最新版本

// ==UserScript==
// @name                 哔哩哔哩直播HEVC假原画屏蔽
// @namespace            http://tampermonkey.net/
// @version              0.1
// @description          通过伪装不支持HEVC来屏蔽哔哩哔哩直播的HEVC假原画
// @author               TGSAN
// @match                https://live.bilibili.com/*
// @match                http://live.bilibili.com/*
// @inject-into          page
// @run-at               document-start
// @grant                unsafeWindow
// ==/UserScript==

(function() {
    'use strict';

    const DISABLE_WASM_PLAYER = true;

    let windowCtx = self.window;
    if (self.unsafeWindow) {
        console.log("[bilibili live hide] use unsafeWindow mode");
        windowCtx = self.unsafeWindow;
    } else {
        console.log("[bilibili live hide] use window mode (your userscript extensions not support unsafeWindow)");
    }

    if (DISABLE_WASM_PLAYER) {
        Object.defineProperty(windowCtx, 'WasmPlayer', {
            configurable: true,
            value: undefined
        });
    }

    windowCtx.MediaSource.isTypeSupportedOriginalBLHEVCDISABLE = windowCtx.MediaSource.isTypeSupported;
    windowCtx.MediaSource.isTypeSupported = function (mimeCodec) {
        if (mimeCodec.indexOf("codecs=\"hvc1") > -1 || mimeCodec.indexOf("codecs=\"hev1") > -1) {
            return false;
        }
        return windowCtx.MediaSource.isTypeSupportedOriginalBLHEVCDISABLE(mimeCodec);
    };
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址