What.CD :: Uploads Auto-Subscriber

Your uploads will be directly subscribed

当前为 2015-11-21 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        What.CD :: Uploads Auto-Subscriber
// @description Your uploads will be directly subscribed
// @include     https://*what.cd/torrents.php*
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @icon        https://what.cd/favicon.ico
// @version     1
// @grant       none
// @namespace https://greasyfork.org/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
var number = str2.replace(/[^0-9]/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(number.indexOf(userid) > -1 && status_subscribe == "Subscribe"){
    
    SubscribeComments(page, pageixd);
}