Greasy Fork

来自缓存

Greasy Fork is available in English.

Redacted.CH :: Uploads Auto-Subscriber

Your uploads will be directly subscribed

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Redacted.CH :: Uploads Auto-Subscriber
// @description Your uploads will be directly subscribed
// @include		http*://*redacted.ch/torrents.php*
// @version		1.2
// @icon        https://redacted.ch/favicon.ico
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_xmlhttpRequest
// @namespace http://greasyfork.icu/users/2290
// ==/UserScript==

// Getting the usernum
var usernum = document.documentElement.innerHTML.match(/user\.php\?id\=[0-9]+/)[0].split("?")[1];
// Converting the userid to only numbers from API
var userid = usernum.replace(/[^0-9]/g, '');

// Getting the torrent ID
var pageid = document.URL.split("=")[1];
var pageixd = pageid.split("&")[0];

var page = 'torrents';

// We get torrent details
var str2 = $("#torrent_details").html();
// Extraction of all userid's possible

//get IDs (this will include torrent IDs and user IDs, but it should be fine
var pttrn = new RegExp('id\=[0-9]+', 'g');
var toast1 = str2.match(pttrn);
//arrange IDs as a comma-separated string
var toast = toast1.toString().replace(/id=/g, '');

// Getting the current subscribing status
var status_subscribe = $("#subscribelink_" + page + pageixd).text();

// If the userid is found in the upload list and if we can subscribe to the release, let's do it!
if(toast.indexOf(userid) > -1 && status_subscribe == "Subscribe"){

    SubscribeComments(page, pageixd);
}