Kissanime Downloader with Jdownloader

Adds Download Button

目前為 2016-06-19 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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\\-*"]')