// ==UserScript== // @name Magnet Links on YTS Fixed // @namespace https://naeembolchhi.github.io/ // @version 0.4 // @description Converts the torrent download links to magnet links on YTS. // @author NaeemBolchhi (fixed by Minoa) // @license GPL-3.0-or-later // @match https://yts.* // @icon data:image/svg+xml;utf8, // @run-at document-end // @grant none // @downloadURL https://update.greasyfork.icu/scripts/493645/Magnet%20Links%20on%20YTS%20Fixed.user.js // @updateURL https://update.greasyfork.icu/scripts/493645/Magnet%20Links%20on%20YTS%20Fixed.meta.js // ==/UserScript== (function() { 'use strict'; function magnetify(hashkey, titlekey) { return `magnet:?xt=urn:btih:${hashkey} &dn=${titlekey} &tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce &tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce &tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce &tr=udp%3A%2F%2Fp4p.arenabg.ch%3A1337%2Fannounce &tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce &tr=http%3A%2F%2Fp4p.arenabg.com%3A1337%2Fannounce &tr=udp%3A%2F%2Fopen.tracker.cl%3A1337%2Fannounce`; } let tLinks = document.querySelectorAll("a[href*='torrent/download/']"); for (let x = 0; x < tLinks.length; x++) { let tHash = tLinks[x].href.replace(/.*download\//,""); let tTitle = tLinks[x].getAttribute("title").replace(/Download\s/,"").replace(/\sTorrent/,"").replace(/\s/g,"$S$"); tLinks[x].href = magnetify(tHash, tTitle).replace(/\s/g,"").replace(/\$S\$/g," "); } })();