Greasy Fork

Greasy Fork is available in English.

IMDb2RARBG

Add direct links to RARBG & TPB from IMDb(.cn)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         IMDb2RARBG
// @namespace    https://mogeko.me
// @version      0.1.1
// @description  Add direct links to RARBG & TPB from IMDb(.cn)
// @author       Mogeko
// @supportURL   https://github.com/Mogeko/userscript-imdb2rarbg/issues
// @match        https://www.imdb.cn/title/*
// @icon         https://cdn.imdb.cn/static/assets/img/imdb.ico
// @grant        none
// @license      MIT
// ==/UserScript==

const IMDB = document.location.toString().split("/")[4];
const SITE_DATA = [
    ["RARBG", "https://rarbgmirror.com/torrents.php?imdb="],
    ["TPB", "https://thepiratebay.org/search.php?q="]
];

(function() {
    'use strict';
    const infoNode = document.querySelector(".txt_bottom");
    const itemNode = document.createElement("div");
    const l_Node = document.createElement("div");
    const r_Node = document.createElement("div");

    itemNode.className = "txt_bottom_item";
    l_Node.className = "txt_bottom_l";
    r_Node.className = "txt_bottom_r txt_bottom_r_overflow";

    l_Node.innerHTML = "资源:";
    SITE_DATA.map(site => {
        const link = document.createElement("a");
        link.textContent = site[0];
        link.href = site[1] + IMDB;
        link.target="_blank";
        return link;
    }).forEach((node, index, array) => {
        r_Node.appendChild(node);
        if (index !== array.length - 1) {
            r_Node.innerHTML += " / ";
        }
    });

    itemNode.appendChild(l_Node);
    itemNode.appendChild(r_Node);
    infoNode.appendChild(itemNode);
})();