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

kat-wrapper

v0.0.4

Published

KAT (Kickass) api wrapper with mirror fallback and advanced search parameters.

Downloads

5

Readme

Kat-wrapper

KAT (Kickass Torrent) api wrapper with mirror fallback and advanced search parameters.

Simple search

var kat = require('kat-wrapper');

kat.search('test').then(function (data) {
        console.log(data);
    }).catch(function (error) {
        console.log(error);
    });

Advanced search

kat.search({
        query: 'Charlie Chaplin',
        category: 'movies',
        min_seeds: '10',
        uploader: 'ettv',
        sort_by: 'seeders',
        order: 'desc',
        verified: 1,
        language: 'en'
    }).then(function (data) {
        console.log(data);
    }).catch(function (error) {
        console.log(error);
    });

Output example:

response:
page: 2
response_time: 743
results: Array[25]
total_pages: 824
total_results: 20578

Use example:

We'll display the magnet link for the most seeded 'Charlie Chaplin' movie.

var kat = require('kat-wrapper');
kat.search({
    query: 'Charlie Chaplin',
    sort_by: 'seeders'
}).then(function (response) {
    console.log(response.results[0].magnet);
}).catch(function (error) {
    console.log('an error occured');
});

Parameters

KAT search requires at least 1 of the following queries: query, category, min_seeds, uploader, safety_filter, verified, language, age

Every other parameter is optionnal.

--

  • query: search terms.
  • as shown on the above examples, it can be passed simply as a string: search('string') if you don't use any other parameter.
  • category: possible values: tv|movies|anime|applications|books|games|music|xxx|other * Subcategories can also be used in the category parameter, but I won't list them.

  • min_seeds: a number, integer. Can be contained in a string.

  • The torrent must be seeded by at least min_seeds people.
  • uploader: a KickassTorrent's username.
  • The torrent was uploaded by uploader.
  • imdb: IMDB id - movies only
  • You can pass the entire id or just the figures: 'tt2561572' or '2561572'.
  • tvrage: TVRage id - tv only

  • sort_by: possible values: seeders|leechers|time_add|files_count

  • order: possible values: asc|desc

  • safety_filter: 0 or 1. (1=true, 0=false)

  • This option turns off all the pornographic content.
  • verified: 0 or 1 (1=true, 0=false)
  • The torrent has been identified as 'not fake' by the community
  • language: langcode or language ID (see below) - only for Movie or TV
  • The spoken language. Example: en or 2.
  • age: possible values: hour|24h|week|month|year
  • The torrent has been uploaded in the last hour,day,week,month,year.
  • page: integer.
  • KAT uses 25 results max per page, navigate between pages (1 to X)

Errors

  • Regular HTTP request errors.

  • Regular Javascript errors.

  • Missing a mandatory parameter: you made an error somewhere.

  • No data: this happens when the server sent back a statusCode > 400 or if the something went wrong with the request, but the server answered.

  • No results: 0 results found. Catch this error to warn your user there were no results for its request, or to know when you reached last page.

Languages

About the language parameter:

  • English: 'en' (id:2)
  • Albanian: 'sq' (id:42)
  • Arabic: 'ar' (id:7)
  • Basque: 'eu' (id:44)
  • Bengali: 'bn' (id:46)
  • Brazilian: 'pt-br' (id:39)
  • Bulgarian: 'bg' (id:37)
  • Cantonese: 'yue' (id:45)
  • Catalan: 'ca' (id:47)
  • Chinese: 'zh' (id:10)
  • Croatian: 'hr' (id:34)
  • Czech: 'cs' (id:32)
  • Danish: 'da' (id:26)
  • Dutch: 'nl' (id:8)
  • Filipino: 'tl' (id:11)
  • Finnish: 'fi' (id:31)
  • French: 'fr' (id:5)
  • German: 'de' (id:4)
  • Greek: 'el' (id:30)
  • Hebrew: 'he' (id:25)
  • Hindi: 'hi' (id:6)
  • Hungarian: 'hu' (id:27)
  • Italian: 'it' (id:3)
  • Japanese: 'ja' (id:15)
  • Kannada: 'kn' (id:49)
  • Korean: 'ko' (id:16)
  • Lithuanian: 'lt' (id:43)
  • Malayalam: 'ml' (id:21)
  • Mandarin: 'cmn' (id:23)
  • Nepali: 'ne' (id:48)
  • Norwegian: 'no' (id:19)
  • Persian: 'fa' (id:33)
  • Polish: 'pl' (id:9)
  • Portuguese: 'pt' (id:17)
  • Punjabi: 'pa' (id:35)
  • Romanian: 'ro' (id:18)
  • Russian: 'ru' (id:12)
  • Serbian: 'sr' (id:28)
  • Slovenian: 'sl' (id:36)
  • Spanish (latin america): '' (id:41) //no langcode, use ID.
  • Spanish: 'es' (id:14)
  • Swedish: 'sv' (id:20)
  • Tamil: 'ta' (id:13)
  • Telugu: 'te' (id:22)
  • Thai: 'th' (id:24)
  • Turkish: 'tr' (id:29)
  • Ukrainian: 'uk' (id:40)
  • Vietnamese: 'vi' (id:38)