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
// Search for all hidden Torrent Magnet URL on pages | |
function searchAllMagnet(){ | |
// Search Torrent Magnet URL on Attributes | |
function searchMagnet(dom){ | |
let trim = (str) => String(str).toString().trim(), magnet = [], regex = /^magnet\:\?.*$/gim | |
dom = trim(dom) | |
if(dom.textContent && regex.test(dom)) magnet.push(dom.textContent) | |
Array.from(dom.attributes) | |
.filter((value) => regex.test(trim(value))) |