// ==UserScript==
// @name Anti-DMCA script for KAT
// @include http*://kickass.so/*.html*
// @include http*://kickass.to/*.html*
// @include http*://kat.ph/*.html*
// @include http*://kat.cr/*.html*
// @include http*://kickassto.co/*.html*
// @include http*://katproxy.is/*.html*
// @include http*://thekat.tv/*.html*
// @version 2.6
// @grant none
// @description Started by PXgamer & Chev.Chelios
// @namespace https://greasyfork.org/users/9596
// @downloadURL https://update.greasyfork.icu/scripts/8470/Anti-DMCA%20script%20for%20KAT.user.js
// @updateURL https://update.greasyfork.icu/scripts/8470/Anti-DMCA%20script%20for%20KAT.meta.js
// ==/UserScript==
// if on torrent page and if DMCA'd
if (/-t\d+\.html($|#.*)/.test(window.location.pathname)&&$('#mainDetailsTable .alertfield').length) {
var torrent_id = window.location.pathname.match(/-t(\d+)\.html($|#.*)/)[1];
var logged_in = $('#navigation > li:last > a[href^="/user/"]').length>0;
$('.tabs .tabNavigation li:first').after('
Technical');
var hash = $('#tab-technical .lightgrey').text().split(': ')[1];
var name = window.location.pathname.split('/')[1];
name = name.substring(0, name.lastIndexOf("-"));
var values = 'Anti-DMCA
Created by: PXgamer, Chev.Chelios & KLOSENTAR
';
var trackers = '';
$('#trackers_table tr:not(.firstr)').each(function() {
if ($(this).find('td.green').length) trackers += '&tr='+euc($(this).find('td:first').text());
});
if (trackers.length === 0) tr = '&tr='+euc('udp://tracker.publicbt.com:80/announce');
var verified = $('.tabs.tabSwitcher').prev().text().indexOf('Torrent verified') >= 0;
var messagetext = "Hey,\nyou can still download this torrent:\n[torrent="+torrent_id+"]\nby using one of these methods (I use method 3):\n[thread=bb7595776]\nSpread the word\n\nP.S. Screw [url=\"/dmca/\"]DMCA[/url] [:Qpirate]";
var buttons = '';
var magnetfb = 'Thank you for choosing Anti-
';
$('.alertfield').after(values+buttons+magnetfb);
$('.downloadButtonGroup .ajaxLink').fancybox();
$(document).delegate('.magnet_fb', 'click', function() {
$('').attr('href', '#magnet_fb').fancybox().click();
});
}
function euc(str) {
return encodeURIComponent(str);
}
function padNum(num) { // 123 ==> 000123
num = '00000000'+num;
return num.substring(num.length-7, num.length);
}