add configure page

This commit is contained in:
mrcanelas
2021-09-11 11:47:09 -03:00
committed by TheBeastLT
parent 7977a0f0fc
commit adc0a6dd71
7 changed files with 27 additions and 26 deletions

View File

@@ -52,7 +52,7 @@ const Providers = {
{
key: 'animestorrent',
label: 'AnimesTorrent',
anime: true
anime: true,
foreign: true
},
{

View File

@@ -1,4 +1,4 @@
{
"projectName": "brazuca-torrents",
"lastCommit": "5706813"
"lastCommit": "5f37b49"
}

5
package-lock.json generated
View File

@@ -854,6 +854,11 @@
}
}
},
"express-rate-limit": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.3.0.tgz",
"integrity": "sha512-qJhfEgCnmteSeZAeuOKQ2WEIFTX5ajrzE0xS6gCOBCoRQcU+xEzQmgYQQTpzCcqUAAzTEtu4YEih4pnLfvNtew=="
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",

View File

@@ -35,7 +35,7 @@ module.exports = [
// { scraper: require('../scrapers/thepiratebay/thepiratebay_dump_scraper') }
// { scraper: require('../scrapers/thepiratebay/thepiratebay_unofficial_dump_scraper') }
// { scraper: require('../scrapers/thepiratebay/thepiratebay_update_size_scraper') }
{ scraper: AnimesTorrent, name: AnimesTorrent.NAME, cron: '0 0 */4 ? * *' },
// { scraper: AnimesTorrent, name: AnimesTorrent.NAME, cron: '0 0 */4 ? * *' },
{ scraper: Comando, name: Comando.NAME, cron: '0 0 */4 ? * *' },
{ scraper: ComoEuBaixo, name: ComoEuBaixo.NAME, cron: '0 0 */4 ? * *' },
{ scraper: DarkMahou, name: DarkMahou.NAME, cron: '0 0 */4 ? * *' },

View File

@@ -130,17 +130,15 @@ function parseTorrentPage(body) {
});
const details = $('div.infox')
const torrent = magnets.map((magnetLink) => {
if (magnetLink.includes("magnet")) {
return {
title: decode(magnetLink).name,
original_name: details.find('h1.entry-title').text(),
year: details.find('b:contains(\'Lançamento:\')')[0].nextSibling.nodeValue.trim(),
infoHash: decode(magnetLink).infoHash,
magnetLink: magnetLink,
category: details.find('b:contains(\'Tipo:\')').next().attr('href').split('/')[4],
uploadDate: new Date($("time[itemprop=dateModified]").attr("datetime")),
};
}
return {
title: decode(magnetLink).name,
original_name: details.find('h1.entry-title').text(),
year: details.find('b:contains(\'Lançamento:\')')[0] ? details.find('b:contains(\'Lançamento:\')')[0].nextSibling.nodeValue.trim() : '',
infoHash: decode(magnetLink).infoHash,
magnetLink: magnetLink,
category: details.find('b:contains(\'Tipo:\')').next().attr('href').split('/')[4],
uploadDate: new Date($("time[itemprop=dateModified]").attr("datetime")),
};
})
resolve(torrent.filter((x) => x));
});

View File

@@ -131,17 +131,15 @@ function parseTorrentPage(body) {
});
const details = $('div.infox')
const torrent = magnets.map((magnetLink) => {
if (magnetLink.includes("magnet")) {
return {
title: decode(magnetLink).name,
original_name: details.find('h1.entry-title').text(),
year: details.find('b:contains(\'Lançado:\')')[0].nextSibling.nodeValue,
infoHash: decode(magnetLink).infoHash,
magnetLink: magnetLink,
category: details.find('b:contains(\'Tipo:\')').next().attr('href').split('/')[4],
uploadDate: new Date($("time[itemprop=dateModified]").attr("datetime")),
};
}
return {
title: decode(magnetLink).name,
original_name: details.find('h1.entry-title').text(),
year: details.find('b:contains(\'Lançado:\')')[0].nextSibling.nodeValue || '',
infoHash: decode(magnetLink).infoHash,
magnetLink: magnetLink,
category: details.find('b:contains(\'Tipo:\')').next().attr('href').split('/')[4],
uploadDate: new Date($("time[itemprop=dateModified]").attr("datetime")),
};
})
resolve(torrent.filter((x) => x));
});

View File

@@ -46,7 +46,7 @@ async function scrapeLatestTorrents() {
}
async function scrapeLatestTorrentsForCategory(category, page = 1) {
console.log(`Scrapping ${NAME} ${category} category page ${page}`);
console.log({Scraper: `Scrapping ${NAME} ${category} category page ${page}`});
return leetx
.browse({ category, page })
.catch((error) => {