含羞草视频无限看

含羞草视频无限看、自动播放,免费看VIP,支持手机端,付费视频无法解决

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        含羞草视频无限看
// @namespace   Violentmonkey Scripts
// @match       *://*/play/video/*
// @grant       none
// @license     MIT
// @version     2.2
// @author      youngyy
// @description 含羞草视频无限看、自动播放,免费看VIP,支持手机端,付费视频无法解决
// ==/UserScript==

function getNowDay() {
    const currentDate = new Date();
    const year = currentDate.getFullYear();
    const month = currentDate.getMonth() + 1;
    const day = currentDate.getDate();

    return `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`
}

const open1 = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {
    if (url.indexOf(".m3u8") > -1) {
        url = url.replace(/start=\d+\&end=\d+\&/, "")
    }
    open1.apply(this, arguments);
};

function findNodeByText(text, startNode = document.body) {
    let stack = [startNode];
    while (stack.length > 0) {
        const currentNode = stack.shift();
        if (currentNode.nodeType === Node.TEXT_NODE) {
            if (currentNode.textContent.trim() === text) {
                return currentNode.parentNode;
            }
        } else if (currentNode.nodeType === Node.ELEMENT_NODE) {
            if (currentNode.childNodes.length > 0) {
                stack = stack.concat(Array.from(currentNode.childNodes));
            }
        }
    }
    return null;
}

function initVideoCountTimes() {
    const obj = {
        time: getNowDay(),
        preNum: 99,
        count: 1,
        num: -94
    };
    localStorage.setItem("preInfo", JSON.stringify(obj))
    localStorage.setItem("tryPlayNum", JSON.stringify(obj))
}

(function () {
    'use strict';
    initVideoCountTimes()

    const observer = new MutationObserver(function (mutations) {
        mutations.forEach(function (mutation) {
            if (mutation.type === 'characterData') {
                setTimeout(() => {
                    initVideoCountTimes()

                    const foundNode = findNodeByText("试看");
                    foundNode?.click()
                }, 300)
            }
        });
    });
    const config = {characterData: true, subtree: true};
    observer.observe(document.body, config);
})();