Kissanime Downloader with Jdownloader

Adds Download Button

当前为 2016-06-19 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Kissanime Downloader with Jdownloader
// @namespace    https://github.com/Meisterlala/Kissanime-Downloader
// @version      v1
// @description  Adds Download Button
// @author       Meisterlala
// @include      */kissanime.*/Anime/*
// @exclude      */kissanime.*/Anime/*/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_setClipboard
// @grant        unsafeWindow
// @grant        GM_log
// @grant        GM_addStyle
// @noframes
// ==/UserScript==



var setClipboard = " --ERROR-- "



function main() {

    //alert(window.location.href)
    var urlnamelong = window.location.href.search("Anime");
    var urlname = window.location.href.substr(urlnamelong + 6);
    var clipboard = $("a[href*=\"" + urlname + "/Episode-" + "\"]").attr('href');
    var epilist = [];
    $("a[href*=\"" + urlname + "/Episode-" + "\"]").each( function() {

        epilist.push("http://kissanime.com" + $(this).attr('href'));

    });
    epilist.pop();
    epilist = epilist.sort();

    setClipboard = epilist.toString()
    GM_setClipboard(setClipboard);
    
     
}






var appendedHTML = `          
    
    <div id="myButtonContainer">
    <button id="myButton" type="button">
    Download with JDownloader
    </button>           
    </div>
    
`;

$("div.bigBarContainer:nth-child(1) > div:nth-child(2) > div:nth-child(2)").append(appendedHTML);

var maincolor = $("div.bigBarContainer:nth-child(1) > div:nth-child(2) > div:nth-child(2) > p:nth-child(2) > a:nth-child(2)").css("color")
var cssstyle = `


    #myButton {
        z-index:                222;
        cursor:                 pointer;
        position:               relative;
        margin-right:           15px;
        font-size:              18px;
        background-color:       transparent;
        outline:                none;
        border:                 none;
        display:                inline-block;
        text-decoration:        none;
        font:                   normal 27px "Tahoma" , Arial, Helvetica, sans-serif;
        transition-duration:    0.4s;
        border-radius:          4px;
		` + "color:                  " + maincolor +`
    }
    #myButton:hover {
        color:                  black;
        ` + "background-color:       " + maincolor +`       
    }
    #myButtonContainer {
        
        text-align:             center;
        
    }
	`
	
GM_addStyle(cssstyle);




// $("#myButton").css("color", maincolor)
// $("#myButton:hover").css("background-color:", maincolor)


// Activate the added button
document.getElementById("myButton").addEventListener (
    "click", ButtonClickAction, false
);

function ButtonClickAction (zEvent) {
    main();    
}




//jQ('a[href^="\\/Anime\\/" + name + "\\/Episode\\-*"]')