Skip to content

Instantly share code, notes, and snippets.

@jlovald
Last active June 15, 2019 10:55
Show Gist options
  • Save jlovald/6d88ef2105332e36e819e37dbaac636e to your computer and use it in GitHub Desktop.
Save jlovald/6d88ef2105332e36e819e37dbaac636e to your computer and use it in GitHub Desktop.
Downloads a batch of episodes from horrible subs. Click on an anime to get to the download list. Run this script in the console (tested for chrome). And click on the copy button at the console output. Paste this into qbittorrent or another client that supports adding a batch of magnet links
// Change to the resolution you desire. "480p", "720p", "1080p".
var res = "1080p";
var x = document.getElementsByClassName("hs-shows")[0];
var li = x.childNodes;
var myRegexp = /<a title="Magnet Link" href="(.*)">Magnet/g;
var x = document.getElementsByClassName("hs-shows")[0];
var li = x.childNodes;
var links = "";
var btn = document.getElementsByClassName("more-button")[0];
function printMagnetLinks() {
for (var i = 0; i < x.childElementCount; i++) {
var inner = li[i].getElementsByClassName("rls-links-container")[0].getElementsByClassName("rls-link link-"+res)[0].innerHTML;
var match = myRegexp.exec(inner);
var m2 = inner.match(myRegexp);
links += match[1] + "\n";
}
console.log(links);
}
var i2 = 0;
var inter = setInterval(function() {
if(i2 == 13) {
alert("End might not be reachable.");
}
if(document.getElementsByClassName("show-more")[0].innerHTML == "No more results" ){
clearInterval(inter);
printMagnetLinks();
}
btn = document.getElementById(""+i2);
if(btn != null) {
btn.click();
i2++;
}
},300);
@jlovald
Copy link
Author

jlovald commented Jan 17, 2019

Updated 17.01.2019:
Horriblesubs changed the string at the bottom of the list from "The end" to "No more results"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment