视频VIP替换

直接在视频页查看会员视频

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);

})();