UNPKG

torrent-search-api-for-barbaroussa

Version:

Yet another node torrent scraper based on x-ray for barbaroussa. (Support iptorrents, torrentleech, torrent9, Yyggtorrent, ThePiratebay, torrentz2, 1337x, KickassTorrent, Rarbg, TorrentProject, Yts, Limetorrents, Eztv)

44 lines (40 loc) 1.42 kB
const TorrentProvider = require('../TorrentProvider'); class Torrent9 extends TorrentProvider { constructor() { super({ name: 'Torrent9', baseUrl: 'https://torrent9.to/', enableCloudFareBypass: true, searchUrl: '/search_torrent/{query}', categories: { All: '', Movies: 'url:/search_torrent/films/{query}.html', TV: 'url:/search_torrent/series/{query}.html', Music: 'url:/search_torrent/musique/{query}.html', Apps: 'url:/search_torrent/logiciels/{query}.html', Books: 'url:/search_torrent/ebook/{query}.html', Games: 'url:/search_torrent/jeux-pc/{query}.html', Top100: 'url:/top' }, defaultCategory: 'All', resultsPerPageCount: 60, itemsSelector: 'table tr', itemSelectors: { title: 'a', time: 'td:nth-child(2)', seeds: '.seed_ok | int', peers: 'td:nth-child(4) | int', size: 'td:nth-child(3)', desc: 'a@href | replace:t//,t/', category: 'i@class' }, paginateSelector: 'a:contains(Suivant ►)@href', torrentDetailsSelector: '.movie-detail > .row:nth-child(1)@html' }); } downloadTorrentBuffer(torrent) { return this.xray(torrent.desc, '.download-btn > a@href') .then(link => this.request(link, { encoding: null })); } } module.exports = Torrent9;