Open ralyodio opened 2 months ago
This code only returns 20 results, can we get data from each provider enabled??
async search(q, mediaType = '') {
let torrents = [];
// Torrent.enablePublicProviders();
for (let provider of [
'1337x',
'Torrent9',
'Torrentz2',
'KickassTorrents',
'Rarbg',
'Yts',
'TorrentProject',
'Limetorrents',
'Eztv'
]) {
Torrent.enableProvider(provider);
}
try {
torrents = await Torrent.search(q, mediaType, 20);
for (let torrent of torrents) {
try {
const magnet = await Torrent.getMagnet(torrent);
console.log('magnet:', magnet);
if (!magnet) continue;
torrent.magnet = magnet;
} catch (err) {
console.error(err);
continue;
}
}
} catch (err) {
console.error(err);
}
console.log(torrents);
return torrents;
}
can you find a way to create a pagination system ?
pagination should be done client side. its too complicated to use scraping for that.
I'm doing enablePublicProviders() and I only get 20 results back, is it possible to give me more results and possibly 20 from each provider?