Greasy Fork

Greasy Fork is available in English.

布雷克影院跳过支付

该脚本用于跳过布雷克影院(http://www.breakvip.com)观影支付环节。

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         布雷克影院跳过支付
// @namespace    https://p00q.cn
// @version      0.4
// @description  该脚本用于跳过布雷克影院(http://www.breakvip.com)观影支付环节。
// @author       DanBai
// @match        http://www.breakvip.com/*
// @icon         http://breakvip.czmhgz.cn/wp-content/uploads/2018/11/c7925a33830e59.ico
// @grant        none
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
// ==/UserScript==

(function () {
    'use strict';
    function getCache(key) {
        if (window.localStorage) {
            var storage = window.localStorage;
            return JSON.parse(storage.getItem(key));
        }
    }
    function setCache(key, data) {
        if (window.localStorage) {
            var storage = window.localStorage;
            storage.setItem(key, JSON.stringify(data));
        }
    }
    Storage.add = function (name, addVal) {
        let oldVal = Storage.get(name)
        let newVal = oldVal.concat(addVal)
        Storage.set(name, newVal)

    }
    function deleteCache(key) {
        if (window.localStorage) {
            var storage = window.localStorage;
            storage.removeItem(key);
        }

    }
    window.onload = function () {
        $(".footmobile").replaceWith(`<div class="footmobile">
        声明本站内容均由站长精心采集自互联网并以此牟利,请联系www.ncac.gov.cn并举报。<br />
        <a href="http://www.ncac.gov.cn/chinacopyright/channels/12578.shtml"
        style="background:red;" target="_blank">点击举报</a>
        </div>`);
        var httpRequest = new XMLHttpRequest();
        httpRequest.open("GET", window.location.href, true);
        httpRequest.send();
        var pattern = /http.*(m3u8|mp4)/;
        httpRequest.onreadystatechange = function () {
            if (httpRequest.readyState == 4 && httpRequest.status == 200) {
                var dp = new DPlayer({
                    element: document.getElementById("dplayer"),
                    autoplay: true,
                    preload: "auto",
                    loop: false,
                    screenshot: false,
                    hotkey: true,
                    video: {
                        url: pattern.exec(httpRequest.responseText)[0],
                    },
                })
                window.dp = dp;
                var key = window.btoa(window.location.href);
                var time = getCache(key);
                if (time != null) {
                    window.dp.seek(time);
                    window.dp.play();
                }
                $(".dplayer").css("width","80%");
                window.setInterval(function () {
                    if (window.dp.video.currentTime > 10) {
                        setCache(key, window.dp.video.currentTime);
                    }
                }, 266);
            }
        };
    }
})();