Skip to content

Instantly share code, notes, and snippets.

@meadhikari
Created November 15, 2012 12:19
Show Gist options
  • Save meadhikari/4078377 to your computer and use it in GitHub Desktop.
Save meadhikari/4078377 to your computer and use it in GitHub Desktop.
Get Torrent link on all Pirate bay Pages.
// ==UserScript==
// @name Get Torrent link on all piratebay link
// @description Sets a torcache link to all torrent files from torcache
// @namespace http://googlesystem.blogspot.com
// @include http://thepiratebay.se/torrent/*
// @include https://thepiratebay.se/torrent/*
// @match http://thepiratebay.se/torrent/*
// @match https://thepiratebay.se/torrent/*
// @author Bikram
// @version 1.4.10
// @date 2012-11-15
// @license MIT License
// ==/UserScript==
(function () {
var aTag = document.createElement('a');
aTag.setAttribute('href',"http://torcache.net/torrent/"+/magnet:\?xt=urn:btih:([a-zA-z0-9]+)/g.exec(document.getElementsByClassName("download")[0].children.item().getAttribute('href'))[1].toUpperCase()+".torrent");
aTag.setAttribute('title',"Right Click and Save")
aTag.innerHTML = "GET TORRENT FILE";
document.getElementsByClassName("download")[0].appendChild(aTag)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment