Skip to content

Instantly share code, notes, and snippets.

@ZaneHannanAU
Created March 27, 2018 05:37
Show Gist options
  • Save ZaneHannanAU/f93f17f845b6fdf04d8ba9fe51af7c06 to your computer and use it in GitHub Desktop.
Save ZaneHannanAU/f93f17f845b6fdf04d8ba9fe51af7c06 to your computer and use it in GitHub Desktop.
horriblesubs magnet links only
// ==UserScript==
// @name HorribleSubs
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://horriblesubs.info/*
// @grant none
// ==/UserScript==
(self => {
function doit() {
for (const pxs of document.getElementsByClassName('release-info')) {
const res = pxs.getElementsByClassName('linkful'), best = res[res.length-1];
if (!best.dataset.clicked) best.children[0].click();
best.dataset.clicked = 1;
for (const px of res) px.hidden = true;
for (const link of document.querySelector(`[class~="${best.id}"`).querySelectorAll('.dl-type:not(.hs-magnet-link)'))
console.log(link, link.hidden = true);
}
}
self.doit = doit.bind(doit);
self.doit.timeout = setTimeout(doit, 4096);
Array.from(document.getElementsByClassName('morebox'), e => e.addEventListener('click',()=>setTimeout(doit, 4096)));
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment