Greasy Fork

Batch download torrents on nyaa.si

Clicking the link column opens all magnets on page

目前为 2018-11-05 提交的版本。查看 最新版本

// ==UserScript==
// @name         Batch download torrents on nyaa.si
// @namespace    vvrvhxnk.qpe
// @version      0.1
// @description  Clicking the link column opens all magnets on page
// @author       vvrvhxnk.qpe
// @include      *nyaa.si/*?f*
// @grant        GM_addStyle
// ==/UserScript==


GM_addStyle ( `
    .hdr-link::after {
        content: "\\f076";
        color: #808080;
        font-size: 0.85em;
		position: absolute;
		top: 12px;
		right: 8px;
		display: block;
		font-family: FontAwesome;
    }
    .hdr-link {
        width: 100px !important;
        cursor: pointer;
    }
` );
(function() {
    $('.hdr-link').attr('title', 'Download all');
    $('.hdr-link').click(function() {
        $('a[href^="magnet:?xt="]').each(function() {
            url = $(this).attr('href');
            open(url);
        });
    });
})();