Greasy Fork

Greasy Fork is available in English.

VIP 视频解析(优化增强版)

支持腾讯视频、爱奇艺、优酷、土豆、芒果TV、搜狐视频、乐视视频、PPTV、风行、华数TV等,支持多个解析接口切换,支持视频自由选集,自动解析视频,支持自定义拖拽位置,支持视频广告跳过,支持10解析,支持 Tampermonkey、Violentmonkey、Greasemonkey

当前为 2020-07-22 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name              VIP 视频解析(优化增强版)
// @version           2.4
// @description       支持腾讯视频、爱奇艺、优酷、土豆、芒果TV、搜狐视频、乐视视频、PPTV、风行、华数TV等,支持多个解析接口切换,支持视频自由选集,自动解析视频,支持自定义拖拽位置,支持视频广告跳过,支持10解析,支持 Tampermonkey、Violentmonkey、Greasemonkey
// @author            sign
// @icon              https://0img.hitv.com/preview/cms_icon/2020/4/5/mangguotvviphuiyuanzhuanqu/20200405011530717.png
// @namespace         http://greasyfork.icu/users/665670
// @require           https://cdn.bootcss.com/jquery/3.5.1/jquery.min.js
// @require           https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// @match             *://v.qq.com/x/cover/*
// @match             *://v.qq.com/x/page/*
// @match             *://www.iqiyi.com/v*
// @match             *://v.youku.com/v_show/*
// @match             *://www.mgtv.com/b/*
// @match             *://tv.sohu.com/v/*
// @match             *://film.sohu.com/album/*
// @match             *://www.le.com/ptv/vplay/*
// @match             *://video.tudou.com/v/*
// @match             *://v.pptv.com/show/*
// @match             *://vip.pptv.com/show/*
// @match             *://www.fun.tv/vplay/*
// @match             *://www.acfun.cn/v/*
// @match             *://www.bilibili.com/video/*
// @match             *://www.bilibili.com/anime/*
// @match             *://www.bilibili.com/bangumi/play/*
// @match             *://vip.1905.com/play/*
// @match             *://www.wasu.cn/Play/show/*
// @match             *://www.56.com/*
// @license           GPL License
// @grant             unsafeWindow
// @grant             GM_openInTab
// @grant             GM.openInTab
// @grant             GM_getValue
// @grant             GM.getValue
// @grant             GM_setValue
// @grant             GM.setValue
// @grant             GM_xmlhttpRequest
// @grant             GM.xmlHttpRequest
// @grant             GM_registerMenuCommand
// @connect           *
// ==/UserScript==

(function () {
    'use strict';
    var $ = $ || window.$;
    var log_count = 1;
    var host = location.host;
    var parseInterfaceList = [];
    var selectedInterfaceList = [];
    var originalInterfaceList = [
        { name:"1907", type:"1", url:"https://z1.m1907.cn/?jx="},
        { name:"17云", type:"1", url:"https://www.1717yun.com/jx/ty.php?url="},
        { name:"通用", type:"1", url:"https://jiexi.bm6ig.cn/?url="},
        { name:"927", type:"1", url:"https://api.927jx.com/vip/?url="},
        { name:"tv920", type:"1", url:"https://api.tv920.com/vip/?url="},
        { name:"8B", type:"1", url:"https://api.8bjx.cn/?url="},
        { name:"ckmov", type:"1", url:"https://www.ckmov.vip/api.php?url="},
        { name:"41", type:"1", url:"https://jx.f41.cc/?url="},
        //--------------------------------------------------------------------------------------
        { name:"1907", type:"0", url:"https://z1.m1907.cn/?jx="},
        { name:"17云", type:"0", url:"https://www.1717yun.com/jx/ty.php?url="},
        { name:"CQ", type:"0", url:"https://cdn.yangju.vip/k/?url="},
        { name:"思古", type:"0", url:"https://api.sigujx.com/?url="},
        { name:"简傲", type:"0", url:"https://vip.fitaxik.cn/?url="},
        { name:"百域", type:"0", url:"https://jx.618g.com/?url="},
        { name:"思古2", type:"0", url:"https://api.bbbbbb.me/jx/?url="},
        { name:"黑米", type:"0", url:"https://www.myxin.top/jx/api/?url="},
        { name:"石云", type:"0", url:"https://jiexi.071811.cc/jx.php?url="},
        { name:"凡凡", type:"0", url:"https://jx.wslmf.com/?url="},
        { name:"人人", type:"0", url:"https://vip.mpos.ren/v/?url="},
        { name:"金桥", type:"0", url:"https://jqaaa.com/jx.php?url="},
        { name:"通用", type:"0", url:"https://jx.598110.com/index.php?url="},
        { name:"初心", type:"0", url:"https://jx.bwcxy.com/?v="},
        { name:"Hk", type:"0", url:"https://jx.rdhk.net/?v="},
        { name:"星空", type:"0", url:"https://jx.fo97.cn/?url="},
        { name:"小蒋极致", type:"0", url:"https://www.kpezp.cn/jlexi.php?url="},
        { name:"维多", type:"0", url:"https://jx.ivito.cn/?url="},
        { name:"927", type:"0", url:"https://api.927jx.com/vip/?url="},
        { name:"tv920", type:"0", url:"https://api.tv920.com/vip/?url="},
        { name:"89", type:"0", url:"https://www.ka61b.cn/jx.php?url="},
        { name:"豪华啦", type:"0", url:"https://api.lhh.la/vip/?url="},
        { name:"宿命", type:"0", url:"https://api.sumingys.com/index.php?url="},
        { name:"8B", type:"0", url:"https://api.8bjx.cn/?url="},
        { name:"千忆", type:"0", url:"https://v.qianyicp.com/v.php?url="},
        { name:"41", type:"0", url:"https://jx.f41.cc/?url="},
        { name:"ckmov", type:"0", url:"https://www.ckmov.vip/api.php?url="},
        { name:"517", type:"0", url:"https://cn.bjbanshan.cn/jx.php?url="},
        { name:"凉城", type:"0", url:"https://jx.mw0.cc/?url="},
        { name:"33t", type:"0", url:"https://www.33tn.cn/?url="},
        { name:"爸比云", type:"0", url:"https://jx.1ff1.cn/?url="},
        { name:"180", type:"0", url:"https://jx.000180.top/jx/?url="},
        { name:"ha12", type:"0", url:"https://py.ha12.xyz/sos/index.php?url="},
        { name:"无名", type:"0", url:"https://www.administratorw.com/video.php?url="},
        { name:"黑云", type:"0", url:"https://jiexi.380k.com/?url="},
        { name:"流氓凡", type:"0", url:"https://jx.wslmf.com/?url="},
        { name:"OK", type:"0", url:"https://okjx.cc/?url="},
        { name:"穷二代", type:"0", url:"https://jx.ejiafarm.com/dy.php?url="},
        { name:"二度", type:"0", url:"https://jx.du2.cc/?url="},
        { name:"bl解析", type:"0", url:"https://vip.bljiex.com/?v="},
        { name:"明日", type:"0", url:"https://jx.yingxiangbao.cn/vip.php?url="},
        { name:"一起走吧", type:"0", url:"https://jiexi.yiqizouba.top/?url="},
        { name:"千叶", type:"0", url:"https://yi29f.cn/vip.php?url="},
        { name:"诺讯", type:"0", url:"https://www.nxflv.com/?url="},
        { name:"大幕", type:"0", url:"https://jx.52damu.com/dmjx/jiexi.php?url="},
        { name:"H8", type:"0", url:"https://www.h8jx.com/jiexi.php?url="},
        { name:"解析S", type:"0", url:"https://jx.jiexis.com/?url="}
    ];

    //自定义 log 函数
    function mylog(param1, param2) {
        param1 = param1 ? param1 : "";
        param2 = param2 ? param2 : "";
        console.group("%cVIP 视频解析(优化增强版)","color: red; font-size: 12px");
        console.log("#" + log_count++ + "-VIP-log:", param1, param2);
        console.groupEnd();
    }

    //内嵌页内播放
    function innerParse(url) {
        $("#iframe-player").attr("src", url);
    }

    //兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+
    function GMopenInTab(url, open_in_background) {
        if (typeof GM_openInTab === "function") {
            GM_openInTab(url, open_in_background);
        } else {
            GM.openInTab(url, open_in_background);
        }
    }

    //兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+
    function GMgetValue(name, value) {
        if (typeof GM_getValue === "function") {
            return GM_getValue(name, value);
        } else {
            return GM.getValue(name, value);
        }
    }

    //兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+
    function GMsetValue(name, value) {
        if (typeof GM_setValue === "function") {
            GM_setValue(name, value);
        } else {
            GM.setValue(name, value);
        }
    }

    //兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+
    function GMaddStyle(css) {
        var myStyle = document.createElement('style');
        myStyle.textContent = css;
        var doc = document.head || document.documentElement;
        doc.appendChild(myStyle);
    }

    //播放节点预处理
    var node = "";
    var player_nodes = [
        { url:"v.qq.com", node:"#mod_player"},
        { url:"www.iqiyi.com", node:"#flashbox"},
        { url:"v.youku.com", node:"#ykPlayer"},
        { url:"www.mgtv.com", node:"#mgtv-player-wrap container"},
        { url:"tv.sohu.com", node:"#player"},
        { url:"film.sohu.com", node:"#playerWrap"},
        { url:"www.le.com", node:"#le_playbox"},
        { url:"video.tudou.com", node:".td-playbox"},
        { url:"v.pptv.com", node:"#pptv_playpage_box"},
        { url:"vip.pptv.com", node:".w-video"},
        { url:"www.wasu.cn", node:"#flashContent"},
        { url:"www.fun.tv", node:"#html-video-player-layout"},
        { url:"www.acfun.cn", node:"#player"},
        { url:"www.bilibili.com", node:"#bilibiliPlayer"},
        { url:"vip.1905.com", node:"#player"},
        { url:"www.56.com", node:"#play_player"}
    ];
    for(var i in player_nodes) {
        if (player_nodes[i].url == host) {
            node = player_nodes[i].node;
        }
    }

    var videoPlayer = $("<div id='iframe-div' style='width:100%;height:100%;z-index:1000;'><iframe id='iframe-player' frameborder='0' allowfullscreen='true' width='100%' height='100%'></iframe></div>");
    var ImgBase64 =`
        data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABB0lEQVR42r2VCw7CIAxAWzQuelsv4ml12XSAhZQFl0L3cWvSwFjhtRQKeu9bALgiCbDQmOfuQHqGuow2whpPpLajTlMAWNKTAhhthDU6zBbbRY
        4D7LRFfQ3geXJIoCM1PIYTQC3JrRZBfooGIRqcA4gThZ/R6zCegI7EmBBIjAY4ogSSAFZNcppEZg9q7jz84WgMKFIDvEkvuVcCKG0bqoBCknEKKICgsIZ6TKEE0GwPBYSzbpYCFm9RMUn/SnJmnO7Az+URPLaZfQI47ttx/pwcCFHm3w7KtU
        gFlB6c/AbXSsVqQC6bAGl/pSoKE5t1tWirHAJ4UXvb6UWLgJ5/NgJgmbfCg/MFf/07iXwnzokAAAAASUVORK5CYII=`;
    var sImgBase64=`
        data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAgUlEQVR42t3UQQqAIBAF0EahE3S1buFtPEY3jGr8QgxEm5D5Cc7GlfP8jigTsVR1ESZQaxxAcF+Xa2ORgEUtAQB1BsQSpJRCzvmkAffqmsAgRt
        M+AHXIYwCsGgj4c8j1y4iNfW1vl2e6OgPbA2DVC0CS2ALjxMcnwD0BTjxD31lAAVVYNypdDsbLAAAAAElFTkSuQmCC`;

    // 视频选集预处理
    function selectedList(episodeList) {
        var innerList = [];
        var innerli = "";
        if (!!episodeList && episodeList.length != 0) {
            episodeList.sort((d1, d2) => { //排序
                var aText1Value = parseInt(d1.name);
                var aText2Value = parseInt(d2.name);
                if (isNaN(aText1Value) || isNaN(aText2Value)) {
                    return 0;
                } else {
                    return aText1Value - aText2Value;
                }
            });
            episodeList.forEach((item, index) => {
                innerList.push(item);
                innerli += "<li title='" + item.description + "'>" + item.name + "</li>";
            });
            var selectedList = innerList;
            $(".vip_mod_box_selected ul li").remove();
            $(".vip_mod_box_selected ul").append(innerli);

            //视频选集事件处理
            $(".selected_text").on("mouseover", () => {
                $(".vip_mod_box_selected").show();
            });
            $(".selected_text").on("mouseout", () => {
                $(".vip_mod_box_selected").hide();
            });
            $(".vip_mod_box_selected li").each((index, item) => {
                item.addEventListener("click", () => {
                    if (document.getElementById("iframe-player") == null) {
                        var player = $(node);
                        player.empty();
                        player.append(videoPlayer);
                    }
                    var num = Math.floor(Math.random() * 7 + 1); //使用随机接口
                    innerParse(parseInterfaceList[num].url + selectedList[index].href);
                });
            });
        }
    }

    // 视频解析预处理
    var innerList = [];
    var outerList = [];
    var innerli = "";
    var outerli = "";
    originalInterfaceList.forEach((item, index) => {
        if (item.type == "1") {
            innerList.push(item);
            innerli += "<li>" + item.name + "</li>";
        } else {
            outerList.push(item);
            outerli += "<li>" + item.name + "</li>";
        }
    });
    parseInterfaceList = innerList.concat(outerList);
    //视频播放图片按钮
    var left = 0;
    var top = 100;
    var Position = GMgetValue("Position_" + host);
    if(!!Position){
        left = Position.left;
        top = Position.top;
    }
    GMaddStyle(`#vip_movie_box {cursor:pointer; position:fixed; top:` + top + `px; left:` + left + `px; width:29px; background-color:#FF4500; z-index:2147483647; font-size:12px; text-align:left;}
		        #vip_movie_box .item_text {width:28px; padding:4px 0px; text-align:center;}
		        #vip_movie_box .item_text img {width:22px; height:22px; display:inline-block; vertical-align:middle;}
                #vip_movie_box .vip_mod_box_action {display:none; position:absolute; left:28px; top:0; text-align:center; background-color:#272930; border:1px solid gray;}
                #vip_movie_box .vip_mod_box_action li{font-size:12px; color:#DCDCDC; text-align:center; width:60px; line-height:21px; float:left; border:1px solid gray; padding:0 4px; margin:4px 2px;}
                #vip_movie_box .vip_mod_box_action li:hover{color:#FF4500;}
		        #vip_movie_box .selected_text {width:28px; padding:4px 0px; text-align:center;}
		        #vip_movie_box .selected_text img {width:22px; height:22px;display:inline-block; vertical-align:middle;}
                #vip_movie_box .vip_mod_box_selected {display:none; position:absolute; left:28px; top:0; text-align:center; background-color:#272930; border:1px solid gray;}
                #vip_movie_box .vip_mod_box_selected li{font-size:14px; color:#DCDCDC; text-align:center; width:23px; line-height:27px; float:left; border:1px dashed gray; padding:0 4px; margin:4px 2px;}
                #vip_movie_box .vip_mod_box_selected li:hover{color:#FF4500;}`);

    var html = $(`<div id='vip_movie_box'>
                    <div class='item_text'>
                       <img src='`+ ImgBase64 +`' title='视频解析'/>
                       <div class='vip_mod_box_action' >
                         <div style='display:flex;'>
                           <div style='width:316px; padding:10px 0;'>
                             <div style='font-size:13px; text-align:center; color:#FFFFFF; line-height:21px;'>站内解析</div>
                             <ul style='margin:0 10px;'>
                               ` + innerli + `
                               <div style='clear:both;'></div>
                             </ul>
                             <div style='font-size:13px; text-align:center; color:#FFFFFF; line-height:21px;'>站外解析</div>
                             <ul style='margin:0 10px;'>
                               ` + outerli + `
                               <div style='clear:both;'></div>
                             </ul>
                           </div>
                         </div>
                       </div>
                    </div>
                    <div class='selected_text' >
                       <img src='`+ sImgBase64 +`' title='视频选集'/>
                       <div class='vip_mod_box_selected' >
                         <div style='display:flex;'>
                            <div style='width:316px; padding:10px 0;'>
                              <div style='font-size:13px; text-align:center; color:#FFFFFF; line-height:21px;'>视频列表</div>
                              <ul style='margin:0 10px;'></ul>
                           </div>
                         </div>
                       </div>
                    </div>
                 </div>`);

    $("body").append(html);

    //视频解析事件处理
    $(".item_text").on("mouseover", () => {
        $(".vip_mod_box_action").show();
    });
    $(".item_text").on("mouseout", () => {
        $(".vip_mod_box_action").hide();
    });
    $(".item_text img").click(() => {
        $.get('https://www.eggvod.cn/jxcode.php',{in:81566699},function(data){
            location.href = 'https://www.eggvod.cn/jx.php?lrspm=' + data + '&zhm_jx='+ location.href;
        });
    });
    $(".vip_mod_box_action li").each((index, item) => {
        item.addEventListener("click", () => {
            if (parseInterfaceList[index].type == "1") {
                if (document.getElementById("iframe-player") == null) {
                    var player = $(node);
                    player.empty();
                    player.append(videoPlayer);
                }
                innerParse(parseInterfaceList[index].url + location.href);
            } else {
                GMopenInTab(parseInterfaceList[index].url + location.href, false);
            }
        });
    });

    // 右键拖拽功能 - 防止与其他脚本干扰
    var movie_box = $("#vip_movie_box");
    movie_box.mousedown(function(e) {
        // 1 = 鼠标左键; 2 = 鼠标中键; 3 = 鼠标右键
        if (e.which == 3) {
            e.preventDefault() // 阻止默认行为
            movie_box.css("cursor", "move");//设置样式
            var positionDiv = $(this).offset();
            var distenceX = e.pageX - positionDiv.left;
            var distenceY = e.pageY - positionDiv.top;
            // 计算移动后的左偏移量 和 顶部的偏移量(防止超出边界)
            $(document).mousemove(function(e) {
                var x = e.pageX - distenceX;
                var y = e.pageY - distenceY;
                if (x < 0) {
                    x = 0;
                } else if (x > $(document).width() - movie_box.outerWidth(true)) {
                    x = $(document).width() - movie_box.outerWidth(true);
                }
                if (y < 0) {
                    y = 0;
                } else if (y > $(document).height() - movie_box.outerHeight(true)) {
                    y = $(document).height() - movie_box.outerHeight(true);
                }
                // 更新样式
                movie_box.css("left", x);
                movie_box.css("top", y);
                GMsetValue("Position_" + host,{ "left":x, "top":y});
            });
            $(document).mouseup(function() {
                $(document).off('mousemove');
                movie_box.css("cursor", "pointer");// 还原样式
            });
            $(document).contextmenu(function(e) {
                e.preventDefault();// 阻止右键菜单默认行为
            })
        }
    });

    //视频广告加速模块
    function method1() {
        window._setTimeout = window.setTimeout
        window.setTimeout = function (handler, timeout, ...arg) {
            window._setTimeout(handler, timeout / 30, ...arg);
        }
    }

    //视频广告加速模块
    function method2() {
        window._setInterval = window.setInterval
        window.setInterval = function (handler, timeout, ...arg) {
            window._setInterval(handler, timeout / 30, ...arg);
        }
    }

    //视频广告加速模块
    function method3() {
        window.rate = 0
        window.Date.now = () => {
            return new window.Date().getTime() + (window.rate += 100000);
        }
        setInterval(() => {
            window.rate = 0
        }, 600000)
    }

    //视频广告加速模块
    function youku() {
        window.onload = function () {
            if (!document.querySelectorAll('video')[0]) {
                setInterval(() => {
                    document.querySelectorAll('video')[1].playbackRate = 16;
                }, 100)
            }
        }
    }

    //视频广告加速模块
    function qq() {
        setInterval(() => {
            if (document.querySelectorAll('video')[0].status == 'IDLE') {
                setInterval(() => {
                    document.querySelectorAll('video')[2].playbackRate = 16;
                    document.querySelectorAll('video')[3].playbackRate = 16;
                }, 100)
            }
        }, 100)
    }

    //屏蔽网站广告 和 支持电视剧选集
    switch (host) {
        case 'www.iqiyi.com':
            method3(); //视频广告加速
            setInterval(() => {
                if (document.getElementsByClassName("cupid-public-time")[0] != null) {
                    $(".skippable-after").css("display", "block");
                    document.getElementsByClassName("skippable-after")[0].click(); //屏蔽广告
                }
                $(".qy-player-vippay-popup").css("display", "none"); //移除会员提示
            }, 500);
            //选集
            setTimeout(() => {
                var episodeList = [];
                var i71playpagesdramalist = $("div[is='i71-play-ab']");
                if (i71playpagesdramalist.length != 0) {
                    var data = i71playpagesdramalist.attr(":page-info");
                    if (!!data) {
                        var dataJson = JSON.parse(data);
                        var albumId = dataJson.albumId;
                        var barlis = $(".qy-episode-tab").find(".bar-li");
                        var barTotal = barlis.length;
                        if(barTotal == 0){
                            barTotal = 1;
                        }
                        for (var page = 1; page <= barTotal; page++) {
                            GM_xmlhttpRequest({
                                url: "https://pcw-api.iqiyi.com/albums/album/avlistinfo?aid=" + albumId + "&page=" + page + "&size=30",
                                method: "GET",
                                headers: {
                                    "Content-Type": "application/x-www-form-urlencoded"
                                },
                                onload: response => {
                                    var status = response.status;
                                    if (status == 200 || status == '200') {
                                        var serverResponseJson = JSON.parse(response.responseText);
                                        var code = serverResponseJson.code;
                                        if (code == "A00000") {
                                            var serverEpsodelist = serverResponseJson.data.epsodelist;
                                            //console.log(serverEpsodelist)
                                            for (var i = 0; i < serverEpsodelist.length; i++) {
                                                var name = serverEpsodelist[i].order;
                                                var href = serverEpsodelist[i].playUrl;
                                                var description = serverEpsodelist[i].subtitle;
                                                episodeList.push({
                                                    "name": name,
                                                    "href": href,
                                                    "description": description
                                                });
                                            }
                                            selectedList(episodeList);
                                        }
                                    }
                                }
                            });
                        }
                    }
                }
            },1000);
            break
        case 'v.qq.com':
            qq(); //视频广告加速
            setInterval(() => {
                var txp_btn_volume = $(".txp_btn_volume"); //打开声音
                if (txp_btn_volume.attr("data-status") === "mute") {
                    $(".txp_popup_volume").css("display", "block");
                    txp_btn_volume.click();
                    $(".txp_popup_volume").css("display", "none");
                }
                $("txpdiv[data-role='hd-ad-adapter-adlayer']").attr("class", "txp_none"); //屏蔽广告
                $(".mod_vip_popup").css("display", "none"); //移除会员提示
                $(".tvip_layer").css("display", "none"); //遮罩层
                $("#mask_layer").css("display", "none"); //遮罩层

            }, 500);
            //选集
            window.onload = function () {
                var episodeList = [];
                var barTotal = "";
                var barlis = $(".mod_episode_filter").find(".item");
                barTotal = barlis.length;
                if(barTotal == 0){
                    barTotal = 1;
                }
                for (var page = 1; page <= barTotal; page++) {
                    $("span[class='item']").click();
                    var mod_episode = $(".mod_episode");
                    if (mod_episode.attr("data-tpl") == "episode"){
                        mod_episode.find(".item").each(function () {
                            var a = $(this).find("a");
                            var href = a.attr("href");
                            if (!!href) {
                                href = "https://v.qq.com" + href;
                                var name = a.text();
                                name = name.replace(/\s/g, "");
                                episodeList.push({
                                    "name": name,
                                    "href": href,
                                    "description": ""
                                });
                            }
                        });
                    }
                    selectedList(episodeList);
                }
            }
            break
        case 'v.youku.com':
            youku(); //视频广告加速
            setInterval(() => {
                var H5 = $(".h5-ext-layer").find("div")
                if(H5.length != 0){
                    $(".h5-ext-layer div").remove(); //屏蔽广告
                    var control_btn_play = $(".control-left-grid .control-play-icon"); //自动播放
                    if (control_btn_play.attr("data-tip") === "播放") {
                        $(".h5player-dashboard").css("display", "block"); //显示控制层
                        control_btn_play.click();
                        $(".h5player-dashboard").css("display", "none"); //隐藏控制层
                    }
                }
                $(".information-tips").css("display", "none"); //信息提示
            }, 500);
            //选集
            window.onload = setTimeout(() => {
                var episodeList = [];
                $(".anthology-content").find(".box-item").each(function () {
                    var title = $(this).attr("title");
                    var href = $(this).attr("href");
                    var markText = $(this).find(".mark-text");
                    if (markText.length == 0 || "预告".indexOf(markText.text) == -1) {
                        if (!!href) {
                            var name = title;
                            var arr = name.split(" ");
                            if (arr.length >= 2) name = arr[arr.length - 1];
                            name = name.replace(/[^0-9]/ig, "");
                            if (!!name) {
                                episodeList.push({
                                    "name": name,
                                    "href": href,
                                    "description": title
                                });
                                //mylog({"name":name, "href":href, "description":title});
                            }
                        }
                    }
                });
                selectedList(episodeList);
            }, 1000);
            break
        case 'www.mgtv.com':
            //选集
            setTimeout(() => {
                var episodeList = [];
                var str = location.href;
                var index = str .lastIndexOf("\/");//斜杠 分割
                str = str.substring(index + 1, str.length);
                index = str.lastIndexOf(".html");
                var albumId = str.substring(0, index);
                //mylog(albumId)
                var barlis = $(".episode-header").find("a");
                var barTotal = barlis.length;
                if(barTotal == 0){
                    barTotal = 1;
                }
                for (var page = 1; page <= barTotal; page++) {
                    GM_xmlhttpRequest({
                        url: "https://pcweb.api.mgtv.com/episode/list?_support=10000000&video_id=" + albumId + "&page=" + page + "&size=30",
                        method: "GET",
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded"
                        },
                        onload: response => {
                            var status = response.status;
                            if (status == 200 || status == '200') {
                                var serverResponseJson = JSON.parse(response.responseText);
                                var code = serverResponseJson.code;
                                if (code == "200") {
                                    var serverEpsodelist = serverResponseJson.data.list;
                                    //mylog(serverEpsodelist)
                                    for (var i = 0; i < serverEpsodelist.length; i++) {
                                        var font = serverEpsodelist[i].corner[0].font;
                                        if(font != "预告"){
                                            var name = serverEpsodelist[i].t1;
                                            var href = serverEpsodelist[i].url;
                                            href = "https://www.mgtv.com" + href;
                                            var description = serverEpsodelist[i].t2;
                                            episodeList.push({
                                                "name": name,
                                                "href": href,
                                                "description": description
                                            });
                                        }
                                    }
                                    selectedList(episodeList);
                                }
                            }
                        }
                    });
                }
            },1000);
            break
        case 'tv.sohu.com':
            setInterval(() => {
                $(".x-video-adv").css("display", "none");//屏蔽广告
                $(".x-player-mask").css("display", "none");//广告提示
                $("#player_vipTips").css("display", "none");//移除会员提示
            }, 500);
            //选集
            window.onload = function () {
                var episodeList = [];
                var barlis = $(".menu_sub").find(".menu_sub_item");
                var barTotal = barlis.length;
                if(barTotal == 0){
                    barTotal = 1;
                }
                for (var page = 1; page <= barTotal; page++) {
                    $("li[data-tab-index='"+ page +"']").click();
                    $(".j-list-wrap").find("li").each(function () {
                        var a = $(this).find("a");
                        var markText = $(this).find(".tips_yu");
                        if (markText.length == 0 && !!a ) {
                            var name = $(this).attr("data-order");
                            var href = a.attr("href");
                            var title = a.attr("data-title");
                            if (!!name && !!href) {
                                href = "https" + href;
                                episodeList.push({
                                    "name": name,
                                    "href": href,
                                    "description": title
                                });
                                //mylog({"name":name, "href":href, "description":title});
                            }
                        }
                    });
                }
                selectedList(episodeList);
            }
            break
        case 'www.fun.tv':
            setTimeout(() => {
                var control_btn_play = $(".fxp-controlbar .btn-toggle"); //自动播放
                if (control_btn_play.is('.btn-play')) {
                    control_btn_play.click();
                }
            }, 500);
            //选集
            window.onload = function () {
                var episodeList = [];
                $(".torrent-panel").find("li").each(function () {
                    var a = $(this).find("a");
                    var href = a.attr("href");
                    var name = a.text();
                    episodeList.push({
                        "name": name,
                        "href": href,
                        "description": ""
                    });
                    //mylog({"name":name, "href":href});
                });
                selectedList(episodeList);
            }
            break
        case 'www.bilibili.com':
            setInterval(() => {
                $(".player-limit-mask").remove();//移除会员提示
            }, 500);
            //选集
            window.onload = function () {
                var episodeList = [];
                var data = unsafeWindow.__INITIAL_STATE__;
                var barTotal = data.epList.length;
                for (var page = 1; page <= barTotal; page++) {
                    i = page - 1
                    var name = data.epList[i].title;
                    var id = data.epList[i].id;
                    var title = data.epList[i].longTitle;
                    if (!!name && !!href) {
                       var href = "https://www.bilibili.com/bangumi/play/ss" + id;
                        episodeList.push({
                            "name": name,
                            "href": href,
                            "description": title
                        });
                    }
                    //mylog({"name":name, "href":href, "description":title});
                }
                selectedList(episodeList);
            }
            break
        default:
            break
    }
})();