Subhd for RARBG

Adds Subhd shortcut to RARBG.to

当前为 2017-06-19 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Subhd for RARBG
// @namespace    http://rarbg.to/
// @version      0.2
// @description  Adds Subhd shortcut to RARBG.to
// @author       tofuliang
// @match        https://rarbg.to/*
// @match        http://rarbg.to/*
// @match        https://rarbg.is/*
// @match        http://rarbg.is/*
// ==/UserScript==

$(document).on('ready AutoPagerize_DOMNodeInserted', function(e) {
	$('a[href^="/torrents.php?imdb="][subhded!=subhded]').each(function() {
		var title = document.location.href.match(/https?:\/\/rarbg\.to\/torrent\/\w+/)?$('body > table > tbody > tr > td > div > div > table > tbody > tr > td > b > h1').text():$(this).parent('td').find('a').text(),
			parts = title.replace(/\s+/g,'.').split('.');
		while(parts.length > 0 && (part = parts.pop().match(/^\d{4}$/)) === null){}
		parts.push(part);
		var keyword = parts.join('.'),
			url='http://subhd.com/search/'+keyword;
		$(this).after('<a style="margin-left:5px;" href='+url+' target="_blank" onmouseover="return overlib(\'<span>去subhd找字幕</span>\')" onmouseout="return nd();"><img src="http://subhd.com/images/favicon-32x32.png" style="height:18px;"></img></a>');
		$(this).attr('subhded','subhded');
	});
});
$(document).bind("ready", function() {});
$(document).ready(function() {
	$(document).trigger("ready");
});