refactors scrapers and add kat and unofficial tpb dump scraper

This commit is contained in:
TheBeastLT
2020-02-23 21:10:35 +01:00
parent 30421815d7
commit 0f91c98b84
14 changed files with 403 additions and 114 deletions

View File

@@ -76,6 +76,9 @@ async function filesFromTorrentStream(torrent) {
if (!torrent.infoHash && !torrent.magnetLink) {
return Promise.reject(new Error("no infoHash or magnetLink"));
}
if (torrent.seeders === 0) {
return Promise.reject(new Error("no seeders for the torrent"));
}
return new Promise((resolve, rejected) => {
const engine = new torrentStream(torrent.magnetLink || torrent.infoHash, { connections: MAX_PEER_CONNECTIONS });