Last active
February 19, 2021 18:25
-
-
Save mnewt/ad0a269c305ea958b67a22ec69bfd79d to your computer and use it in GitHub Desktop.
Add magnet links to Torrentz2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Torrentz2 Magnet Links | |
// @namespace mnewt | |
// @description Add magnet links to Torrentz2 search results | |
// @include https://torrentz2.eu/* | |
// @include https://torrentz2.me/* | |
// @include https://torrentz2.is/* | |
// @include https://torrentzwealmisr.onion.ly/* | |
// @version 1.2 | |
// @grant GM_addStyle | |
// @inject-into auto | |
// ==/UserScript== | |
const linkText = "🧲 "; | |
const defaultTrackers = ` | |
udp://tracker.opentrackr.org:1337/announce | |
udp://tracker.internetwarriors.net:1337/announce | |
udp://exodus.desync.com:6969/announce | |
udp://tracker.cyberia.is:6969/announce | |
http://explodie.org:6969/announce | |
udp://opentracker.i2p.rocks:6969/announce | |
udp://47.ip-51-68-199.eu:6969/announce | |
http://open.acgnxtracker.com:80/announce | |
udp://open.stealth.si:80/announce | |
udp://www.torrent.eu.org:451/announce | |
udp://tracker.torrent.eu.org:451/announce | |
udp://tracker.tiny-vps.com:6969/announce | |
udp://tracker.ds.is:6969/announce | |
udp://retracker.lanta-net.ru:2710/announce | |
udp://tracker.moeking.me:6969/announce | |
udp://tracker.dler.org:6969/announce | |
udp://ipv4.tracker.harry.lu:80/announce | |
http://rt.tace.ru:80/announce | |
udp://valakas.rollo.dnsabr.com:2710/announce | |
udp://opentor.org:2710/announce | |
`; | |
const trackerQuery = defaultTrackers.replace(/\n/g,"&tr="); | |
document.querySelectorAll('dl dt a').forEach(function(a) { | |
const hash = a.href.substr(a.href.length - 40); | |
const magnetUri = "magnet:?xt=urn:btih:" + hash + "&dn=" + a.textContent + trackerQuery; | |
const magnetLink = document.createElement("a"); | |
magnetLink.href = magnetUri; | |
magnetLink.style.fontWeight = "bold"; | |
magnetLink.innerHTML = linkText; | |
a.parentNode.insertBefore(magnetLink, a); | |
}); |
It seems that many of the mirrors of https://greasyfork.org/zh-TW/scripts/23145-torrentz2-dot-eu-magnet-link are DEAD.
Embarrassing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For https://github.com/netravnen/torrentz2-magnet-link/blob/master/Torrentz.eu%20magnet%20and%20direct%20links.user.js they seemed to be able to combine the trackers together.
With https://greasyfork.org/zh-TW/scripts/23145-torrentz2-dot-eu-magnet-link it seems that there are a lot of Torrentz2 mirrors.