newpct-scrapper
Version:
Utilidades para newpct
14 lines (12 loc) • 349 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getTorrent;
/* Se le pasa una página HTML y busca un .torrent
*/
function getTorrent(html) {
let match = html.match(/href=.(.+\.torrent)./im);
if (!match) throw new Error('No se ha encontrado ningún torrent en este HTML');
return match[1];
}