Greasy Fork

Greasy Fork is available in English.

Search for anime titles on Nyaa.si from Anilist.co

Adds a button under the title of anime/manga on Anilist.co, this button sends you to search results on the torrent site Nyaa.si

当前为 2022-05-22 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Search for anime titles on Nyaa.si from Anilist.co
// @description Adds a button under the title of anime/manga on Anilist.co, this button sends you to search results on the torrent site Nyaa.si
// @version 0.01
// @license MIT
// @match       *://anilist.co/anime/*
// @match       *://anilist.co/manga/*
// @grant       GM_addStyle
// @namespace http://greasyfork.icu/users/916662
// ==/UserScript==

var header;
function waitForElement(){
    if(typeof header != "undefined"){
        var title = header.innerText;
        let button = document.createElement("a");
        button.setAttribute("href", `https://nyaa.si/?f=0&c=0_0&q=${title}&s=seeders&o=desc`);
        button.setAttribute("class", "search_button");
        button.textContent = "Nyaa Search";
        document.getElementsByClassName('actions')[0].appendChild(button);

    } else {
        header = document.getElementsByTagName("h1")[0];
        setTimeout(waitForElement, 250);
    }
}
waitForElement();

GM_addStyle ( `
    .search_button {
        align-items: center;
        background: #1f1f1f;
        border-radius: 3px;
        color: #fff !important;
        display: flex;
        font-size: 1.4rem;
        height: 35px;
        justify-content: center;
        line-height: 1.3rem;
    }
    .search_button:hover {
        background: #3d3d3d;
    }
` )