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

torrent-project-api

v1.0.4

Published

Torrent search API for torrentproject.se

Downloads

18

Readme

Torrent Project API npm

Torrent search API for torrentproject.se

install

npm install torrent-project-api

example

var tp = require('torrent-project-api')

tp.search('ubuntu', function (err, result) {
  if (err) return console.error(err)

  console.log('Found ' + result.torrents.length + ' torrents out of ' + result.total + ' results.')

  console.log('The top result was: ' + result.torrents[0].title)

  tp.magnet(result.torrents[0], function (err, link) {
    if (err) return console.error(err)
    console.log('Here is a magnet link for it:')
    console.log(link)
  })
})

The result object looks like this:

{ total: 18427,
  torrents: [
    { title: 'ubuntu-14.04.3-desktop-amd64.iso',
      category: 'ALL',
      seeds: 3226,
      leechs: 59,
      size: 1054867456,
      hash: '743bc6fad39e3a35460d31af5322c131dd196ac2' },
    { ... }
  ]
}

usage

search

Search for torrents

var query = ['key', 'words']        // array or string

var options = {
  limit: 10,                        // amount of results (1-100)
  order: 'peers',                   // sort order
  filter: 'tv'                      // filter by category
}

tp.search(query, options, callback) // or simply tp(...)

Sort order for options.order can be found in tp.orderings:

best, latest, seeders, oldest, speed, peers, sizeD, sizeA

Categories for options.filter can be found in tp.filters:

all, audio, lossless, mp3, video, tv, dvdrip, hdrip, dvd, lq, ebooks, comics, magazines, tutorials, audiobook, images, mobile, games, pc, nintendo, playstation, xbox, applications, adult

magnet

Get magnet link for result.torrents[]

tp.magnet(torrent, function (err, link) { })

The returned magnet link:

magnet:?xt=urn:btih:743bc6fad39e3a35460d31af5322c131dd196ac2&dn=ubuntu-14.04.3-desktop-amd64.iso&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fgalliumsurfer.tk%3A6969%2Fannounce

trackers

Receive a list of trackers from result.torrents[] or infohash

tp.trackers(torrent, function (err, trackers) { })

Returns list of trackers:

[ 'udp://tracker.leechers-paradise.org:6969/announce', 'udp://galliumsurfer.tk:6969/announce', ... ]

peers

Receive amount of seeders and peers from result.torrents[] or infohash

tp.peers('743bc6fad39e3a35460d31af5322c131dd196ac2', function (err, peers) { })

Returns list of peers:

{ seeds: '3226', leechs: '59' }

license

MIT