// ==UserScript==
// @name Download All Torrents or Magnets
// @namespace pxgamer
// @version 0.1
// @description Adds buttons to download all torrents or magnets on a page.
// @author pxgamer
// @include *kat.cr/*
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
var url = "";
$('#mainSearchTable').before(' ');
$('.downloadAll').click(function () {
switch ($(this).attr('data-dl-type')) {
case 'magnet':
$('a.icon16.askFeedbackjs[data-nop][href^="magnet:?xt="]').each(function () {
url = $(this).attr('href');
open(url);
});
break;
case 'torrent':
$('a.icon16.askFeedbackjs[data-download][href^="/torrents/"]').each(function () {
url = $(this).attr('href');
open(url);
});
break;
default:
console.info('No Method Selected');
}
});
})();