Greasy Fork is available in English.

视频跳过广告和 VIP 视频解析

也许是风格最贴近原视频网站的 VIP 视频解析脚本了,添加的解析按钮样式跟原视频网站已有的按钮一致,不会产生突兀感

Version au 2018-10-16 04:20:19 UTC. Voir la dernière version.

// ==UserScript==
// @name              视频跳过广告和 VIP 视频解析
// @name:en           Kill ADs and Watch VIP Videos
// @namespace         http://mofiter.com/
// @version           0.3
// @description       也许是风格最贴近原视频网站的 VIP 视频解析脚本了,添加的解析按钮样式跟原视频网站已有的按钮一致,不会产生突兀感
// @description:en    maybe it's the most similar VIP videos script to origin website
// @author            mofiter
// @create            2018-10-05
// @lastmodified      2018-10-16
// @require           https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @match             http*://v.qq.com/x/cover/*
// @match             http*://www.iqiyi.com/v*
// @match             http*://v.youku.com/v_show/*
// @match             http*://www.mgtv.com/b/*
// @match             http*://tv.sohu.com/v/*
// @match             http*://www.le.com/ptv/vplay/*
// @match             http*://video.tudou.com/v/*
// @grant             unsafeWindow
// ==/UserScript==

(function() {
    'use strict';
    var $ = $ || window.$;
    var log_count = 1;

    //自定义 log 函数
    function mylog(param1,param2){
        param1 = param1 ? param1 : "";
        param2 = param2 ? param2 : "";
        console.log("#" + log_count++ + "-VIP-log:",param1,param2);
    }

    setTimeout(function(){
        var videoPlayer = $("<div style='width:100%;height:100%;z-index:2147483647;'><iframe frameborder='0' width='100%' height='100%' src='https://api.bbbbbb.me/jx/?url=" + location.href + "'></iframe></div>");
        if (location.href.indexOf("www.iqiyi.com") > -1){
            var qy_flash_func = $(".qy-flash-func");
            var iqiyi_jiexi = $("<article class='func-item' style='margin-top:9px;'><span class='func-inner'><span class='func-name'>解析</span></span></article>");
            qy_flash_func.prepend(iqiyi_jiexi);
            iqiyi_jiexi.click(()=>{
                document.getElementById("nav_LR").querySelector("a").click();
                var flashbox = $("#flashbox");
                flashbox.attr("z-index","400");
                flashbox.empty();
                flashbox.append(videoPlayer);
            });
            var iqiyi_jiexi_new = $("<div style='float:left;color:#999;cursor:pointer;'><span class='func-name'>解析</span></div>");
            var funcRight = $(".funcRight");
            funcRight.prepend(iqiyi_jiexi_new);
            iqiyi_jiexi_new.click(()=>{
                var vipFloatbgCls = $(".vipFloatbgCls").parent();
                $(vipFloatbgCls).css("display","none");
                $(".J_play-underFrame").css("display","none");
                document.getElementsByClassName("usrTx-register")[0].querySelector("a").click()
                $("#flashbox").empty();
                $("#flashbox").append(videoPlayer);
            });
            iqiyi_jiexi_new.on("mouseover",()=>{
                iqiyi_jiexi_new.css("color","#6ba430");
            });
            iqiyi_jiexi_new.on("mouseout",()=>{
                iqiyi_jiexi_new.css("color","#999");
            });
            setInterval(()=>{
                if($(".qy-player-vippay-popup") != null){
                    var qy_player_vippay_popup = $(".qy-player-vippay-popup").parent();
                    $(qy_player_vippay_popup).css("display","none");
                }
                var div = $("body").children("div");
                div.each((index,item)=>{
                    try{
                        if($(item).css("position") === "fixed"){
                            $(item).remove();
                        }
                    }catch(err){
                        mylog(err);
                    }
                });
            },500);
        }else if(location.href.indexOf("v.qq.com") > -1){
            var type_name = unsafeWindow.COVER_INFO.type_name;
            var vipPage = unsafeWindow.COVER_INFO.vipPage;
            var mod_player;
            if(type_name === "电影"){
                var list_item = $(".mod_figure_list .list_item");
                list_item.each(function(index,item){
                    item.addEventListener('click',()=>{
                        setTimeout(()=>{
                            location.reload();
                        },1000);
                    });
                });
            }else if(type_name === "电视剧"){
                var select_items = $('.mod_episode .item');
                select_items.each(function(index,item){
                    item.addEventListener('click',()=>{
                        setTimeout(()=>{
                            location.reload();
                        },1000);
                    });
                });
                var mod_episode_filter = $(".mod_episode_filter");
                mod_episode_filter.click(()=>{
                    var select_items = $('.mod_episode .item');
                    select_items.each(function(index,item){
                        item.addEventListener('click',()=>{
                            setTimeout(()=>{
                                location.reload();
                            },1000);
                        });
                    });
                });
            }
            var txp_right_controls = $(".txp_right_controls");
            var qq_jiexi = $("<txpdiv class='txp_btn txp_btn_definition' id='jiexi_btn'><txpdiv class='txp_label'>解析</txpdiv></txpdiv>");
            txp_right_controls.prepend(qq_jiexi);
            qq_jiexi.click(()=>{
                var mod_player;
                var txp_ad_skip_text = $(".txp_ad_inner .txp_ad_skip_text");
                if(txp_ad_skip_text.text() === "VIP可关闭广告"){
                    txp_ad_skip_text.click();
                    mod_player = $("#mod_player");
                    mod_player.empty();
                    mod_player.append(videoPlayer);
                }else if(txp_ad_skip_text.text() === "关闭广告"){
                    txp_ad_skip_text.click();
                }else if(type_name === "电视剧" || type_name === "电影" || type_name === "综艺" && vipPage === true){
                    var txp_btn_play = $(".txp_left_controls .txp_btn_play");
                    if(txp_btn_play.attr("data-status") === "pause"){
                        txp_btn_play.click();
                    }
                    mod_player = $("#mod_player");
                    mod_player.empty();
                    mod_player.append(videoPlayer);
                }
            });
            setInterval(()=>{
                $(".tvip_layer").css("display","none");
                $("#mask_layer").css("display","none");
            },500);
        }else if(location.href.indexOf("v.youku.com") > -1){
            setInterval(()=>{
                $(".yk-dmtxtbox").css("width","300px");
            },1000);
            var bpmodule_playpage_paction = $("#bpmodule-playpage-paction .play-fn");
            var youku_jiexi = $("<li><span class='text'>解析</span></li>");
            bpmodule_playpage_paction.append(youku_jiexi);
            youku_jiexi.click(()=>{
                var ykPlayer = $("#ykPlayer");
                ykPlayer.empty();
                ykPlayer.append(videoPlayer);
                $("#module_basic_player").css("height","100%");
                var player = $("#player");
                player.css("height","100%");
                player.empty();
                player.append(videoPlayer);
            });
        }else if(location.href.indexOf("www.mgtv.com") > -1){
            var v_panel_box = $(".v-panel-box");
            var mgtv_jiexi = $("<div class='v-panel-mod' style='cursor:pointer;'><a class='v-panel-submod'>解析</a></div>");
            v_panel_box.append(mgtv_jiexi);
            mgtv_jiexi.click(()=>{
                var mgtv_player_wrap = $("#mgtv-player-wrap");
                mgtv_player_wrap.empty();
                mgtv_player_wrap.append(videoPlayer);
            });
            var selected_items = $(".aside-tabbox li");
            selected_items.each(function(index,item){
                item.addEventListener('click',()=>{
                    setTimeout(()=>{
                        location.reload();
                    },1000);
                });
            });
        }else if(location.href.indexOf("tv.sohu.com") > -1){
            var vBox_right = $(".vBox-right");
            var sohu_jiexi = $("<div class='vBox vBox-play'><a class='vbtn'>解析</a></div>");
            vBox_right.prepend(sohu_jiexi);
            sohu_jiexi.click(()=>{
                var player_vipTips = $("#player_vipTips");
                player_vipTips.css("display","none");
                if(document.querySelector("#menu") == null){
                    var sohuplayer = $("#sohuplayer");
                    sohuplayer.empty();
                    sohuplayer.append(videoPlayer);
                }else{
                    var player = $("#player");
                    player.empty();
                    player.append(videoPlayer);
                }
            });
        }else if(location.href.indexOf("www.le.com") > -1){
            var interact_area = $(".interact_area");
            var le_jiexi = $("<li><a><span>解析</span></a></li>");
            interact_area.prepend(le_jiexi);
            le_jiexi.click(()=>{
                var le_playbox = $("#le_playbox");
                le_playbox.empty();
                le_playbox.append(videoPlayer);
            });
        }else if(location.href.indexOf("video.tudou.com") > -1){
            var td_interactbox = $(".td-interactbox__fn--right");
            var tudou_jiexi = $("<div class='td-interactbox__fn__item' style='cursor:pointer;color:#fff;'><div>解析</div></div>");
            td_interactbox.prepend(tudou_jiexi);
            tudou_jiexi.click(()=>{
                var js_player = $(".td-playbox");
                js_player.empty();
                js_player.append(videoPlayer);
            });
            tudou_jiexi.on("mouseover",()=>{
                tudou_jiexi.css("color","#ef6f2e");
            });
            tudou_jiexi.on("mouseout",()=>{
                tudou_jiexi.css("color","#fff");
            });
        }
    },3000);
})();