Greasy Fork

Subs Adder [KAT]

Adds subtitle YIFYSubs link to KAT pages

目前为 2015-05-14 提交的版本。查看 最新版本

// ==UserScript==
// @name        Subs Adder [KAT]
// @namespace   SexyWolfie
// @include     *kickass.to/*.html*
// @version     2.2
// @grant       none
// @description Adds subtitle YIFYSubs link to KAT pages
// ==/UserScript==

if ($('.dataList').length==1) {
  if (/\/movies\//i.test($('span[id^="cat_"]').html())) {
    var imdbID = $('.dataList [href*="www.imdb.com/title/"]').html();
    $('.dataList .textButton[href^="/bookmarks/"]').after(' <a title="Check YIFY Subtitles" href="http://www.yifysubtitles.com/movie-imdb/tt'+imdbID+'/" class="postLink icon16 textButton isearch"><span></span>check for subtitles</a>');
  }else if (/\/tv\//i.test($('span[id^="cat_"]').html())) {
    var episode = $('.dataList li:first strong').html()+((/S\d\dE\d\d/).test($('.dataList ul:first').html()) ? ' '+$('.dataList ul:first').html().match(/S\d\dE\d\d/)[0] : '');
    $('.dataList .textButton[href^="/bookmarks/"]').after(' <a title="Check Addic7ed.com" href="http://www.addic7ed.com/search.php?search='+encodeURIComponent(episode)+'&Submit=Search" class="postLink icon16 textButton isearch"><span></span>check for subtitles</a>');   
  }
}