视频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 or Violentmonkey 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		视频VIP替换
// @namespace	http://tampermonkey.net/
// @version		1.2
// @description	直接在视频页查看会员视频
// @author		You
// @match		*.iqiyi.com/v*
// @grant		none
// @run-at		document-start
// @require		https://code.jquery.com/jquery-3.2.1.min.js
// ==/UserScript==

(function() {
    'use strict';

    var vip_parse_url = "https://danmu.sonimei.cn/player/?url=&url=";
    // 替换播放器


    function sleep(numberMillis) {
        var now = new Date();
        var exitTime = now.getTime() + numberMillis;
        while (true) {
            now = new Date();
            if (now.getTime() > exitTime)
                return;
        }
    }

    function gen_iqiyi_player(current_url) {
        console.log('ready to replace');
        // 生成替换源
        var request_url = '<iframe id="play_iframe" allowfullscreen="true" ' +
            'style="background-color: #dff0d8;" width="100%" height="100%" ' +
            'allowtransparency="true" frameborder="0" scrolling="no" ' +
            'src="' + vip_parse_url + current_url + '"></iframe>';
        console.log(request_url);
        return request_url;
    };

    function get_vip() {
        var current_url = window.location.href;
        var request_url = gen_iqiyi_player(current_url);
        if (current_url.indexOf("www.iqiyi.com") != -1) {
            $('#iframaWrapper').empty().html(request_url);

            $("#contentArea").remove();
            $("#block-AR").remove();
        }


    }

    setTimeout(function(){
        get_vip();
    }, 1000);

})();