KissAnime RapidVideo Custom Player

No ads, faster, download options, no viruses, html5

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         KissAnime RapidVideo Custom Player
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  No ads, faster, download options, no viruses, html5
// @author       You
// @match        http://kissanime.ru/Anime/*/*
// @require      https://code.jquery.com/jquery-1.12.4.min.js
// @require     https://cdn.rawgit.com/Eltion/KissAnime-RapidVideo/112df41f394b4ca5924d9d4e11b77cf6cf7bda93/player1.js

// @grant        GM_xmlhttpRequest
// ==/UserScript==


var current = 0;
var UrlQ;
var bestQ = "";


(function() {
    var iframe = $("#divContentVideo").find("iframe").attr("src");
    if(iframe.includes("rapidvideo")){
        $("#divContentVideo").html("");

        $('head').append('<link rel="stylesheet" href="//releases.flowplayer.org/7.2.1/skin/skin.css">');

        $('#divContentVideo').html('<div id="player"></div>');
        $("#divQuality").html("<select  id='quality'></select>");
        $("#divQuality").css({"display":"inline-block"});

        $("#quality").on("change",function(){
            var val = $(this).val();
            change(val);
        });

        rapidvideoGetQualities(iframe);

        flowplayer(function (api, root) {
            var fsbutton = root.querySelector(".fp-fullscreen");
            api.on("ready", function () {
                root.querySelector(".fp-controls").appendChild(fsbutton);
            });
        });
    }

})();


  function rapidvideoGetQualities(url){
    var k = "";
      var re = new RegExp(url+"&q=\\d*p","g");
    GM_xmlhttpRequest({
        method: "GET",
        url: ""+url,
        synchronous: true,
        onload: function(response) {
            var e = response.responseText.match(re);
            if (e === undefined || e === null) {

            }else{
                UrlQ = e;
                rapidvideo(e[0]);
            }
        }
    });


}

function rapidvideo(url){
    if(current >= UrlQ.length ){
        setPlayer(bestQ);
        $("#quality").find("option").last().attr("selected",'');
    }else{
    GM_xmlhttpRequest({
        method: "GET",
        url: ""+url,
        synchronous: true,
        onload: function(response) {
            var e = response.responseText.split('<source src="')[1].split('"')[0];
            if (e === undefined || e === null) {
                console.log(response.responseText);
            }else{
                var label = response.responseText.match(/title="\d*p"/g)[0].split('"')[1];
                bestQ = e;
                $("#quality").append("<option value='"+e+"'>"+label+"</option>");
               current++;
                rapidvideo(UrlQ[current]);
            }
        }
    });
    }
}

function change(val){
    flowplayer(0).load(val);
    $("#Download").attr("href",val);
}

function setPlayer(val){
     flowplayer("#player", {
                    clip: {
                        sources: [
                            { type: "video/mp4",
                             src:  val }
                        ]
                    }
                });
               $("#Download").attr("href",val);
}