npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

espatorrla

v1.0.2

Published

Avoid torrent pages ads, coinminers and bloatware with this torrent scraper

Downloads

1

Readme

Espatorrla - Spanish Torrent Scraping Build Status Coverage Status Codacy Badge

This tool aims to extract all the desired torrents from Spanish Torrent Pages with certain template. With this, you can store them in a safe place and use it for whatever you want

Requirements

  • NodeJS 8.11 at least.

Installation

npm install espatorrla --save

Usage

This package comes with three methods.

getWorkingPage

Because of common online connectivity problems with torrenting pages, the getWorkingPage method returns which URL is working at the desired moment. By default, it scrapes Descargas2020 and TorrentRapid, but you can test any URL.

const { getWorkingPage } = require('espatorrla')

getWorkingPage(['url1', 'url2'])
  .then(url => {
    console.info(`Working URL is ${url}`); 
  })
  .catch(err => {
    console.error('No working URLs found at this moment :(')
  })

getItemsForCategory

Searches for torrents in a category. The search can be customized to stop at a certain page, element or date. The object parameters are the following:

{
  "url": "http://someurl.com", // URL to be scraped. Can be obtained from the previous method. Required.
  "category": {
    "id": 429, // Id of the category. Some of them are available at the categories.json file. Required.
    "description": "HD Movies" // Descripcion of the category. Required.
  }, 
  "limitPage": 3, // Max pages to be scraped. Optional. If not provided, it will scrape all pages.
  "limitItem": "http://someurl.com/myfilm", // URL of the item to be stopped at. Optional. This is useful when scraping new content from last executions
  "date": "Mes", // Age of the torrents. Optional. It can be one of these: Hoy, Ayer, Semana, Mes, Siempre.
  "initPage": 2 // Initial page to search. Optional. It has to be lower than limitPage
}

The method returns an array of objects, consisting of each item. The information provided is the following:

[
  {
   "url": "http://someurl.com/myfilm", // Item's details URL
   "title": "My favourite movie", // Title of the item
   "image": "http://someurl.com/myfilm-cover.jpg", // URL of the image attached to the item (usually the cover)
   "quality": "MicroHD", // Image quality of the item
   "category": {
      "id": 429, 
      "description": "HD Movies"
   }
  }
]

So, the usage is like this:

const { getItemsForCategory } = require('espatorrla')

const options = {
  url: 'http://torrentrapid.com/ultimas-descargas',
  category: {
    id: 1027,
    description: "HD Movies"
  },
  limitPage: 3,
  limitItem: 'http://torrentrapid.com/myfilm',
  date: 'Siempre'
}

getItemsForCategory(['url1', 'url2'])
  .then(items => {
    console.log(items)
  })
  .catch(err => {
    console.error('Cannot scrape torrents for given parameters at this moment :(')
  })

getTorrentLink

Extracts the .torrent file URL of a given URL.

const { getTorrentLink } = require('espatorrla')

getTorrentLink('http://torrentrapid.com/descargar/peliculas-castellano/contrato-mortal/')
  .then(torrent => {
    console.info(`Torrent URL: ${torrent}`); 
  })
  .catch(err => {
    console.error('Could not find any torrent on given URL :(')
  })

Built with