Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

thehiddenbay

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thehiddenbay - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

34

index.js
const cheerio = require('cheerio');
const axios = require('axios');
async function piratebay({query, category, page = '1'}) {
if (category === 'Movies') {
category = '99/0';
} else if (category === 'Series') {
category = '205';
} else {
category = '';
}
async function piratebay({query}) {
const torrents = [];
const url = 'https://thehiddenbay.com/search/' + query + '/' + page + '/' + category;
const url = 'https://thehiddenbay.com/search/' + query + '/1/99/200';
let html;

@@ -22,27 +13,22 @@ try{

}
const $ = cheerio.load(html.data);
$("table#searchResult tr").each((_, element) => {
$('table#searchResult tr').each((_, element) => {
const data = $(element).find('font.detDesc').text().replace(/(Size|Uploaded)/gi, '').replace(/ULed/gi, 'Uploaded').split(',').map(value => value.trim());
const date = data[0]
const size = data[1]
const uploader = $(element).find('font.detDesc a').text()
const date = data[0];
const size = data[1];
const torrent = {
title: $(element).find('a.detLink').text(),
magnet: $(element).find("td div.detName").next().attr('href'),
url: $(element).find('a.detLink').attr('href'),
magnet: $(element).find('td div.detName').next().attr('href'),
seed: $(element).find('td').eq(2).text(),
leech: $(element).find('td').eq(3).text(),
size: size,
uploader: uploader,
size: size ? size.replace('i', '') : size
}
if (torrent.title.length) {
torrents.push(torrent)
torrents.push(torrent);
}
});
});
return {domain: url, query: query, torrents};
}
}
module.exports.search = piratebay;
{
"name": "thehiddenbay",
"description": "thepiratebay unoffical api",
"author": {
"name": "Persei08",
"email": "persei8@protonmail.ch"
},
"version": "1.0.3",
"bugs": {
"url": "https://github.com/Persei08/thepiratebay/issues"
},
"dependencies": {

@@ -9,2 +16,3 @@ "axios": "^0.21",

},
"description": "thepiratebay unoffical api",
"devDependencies": {

@@ -19,9 +27,2 @@ "expect.js": "^0.3.1",

"homepage": "https://github.com/Persei08/thepiratebay#readme",
"author": {
"name": "Persei08",
"email": "persei8@protonmail.ch"
},
"bugs": {
"url": "https://github.com/Persei08/thepiratebay/issues"
},
"keywords": [

@@ -42,4 +43,3 @@ "tv",

"test": "mocha test.js --reporter spec --timeout 15000 --require mocha-clean"
},
"version": "1.0.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc