Home Manual Reference Source Repository
public class | source

KAT

Class for scraping movies from https://kat.cr/.

Constructor Summary

Public Constructor
public

constructor(name: String, debug: Boolean)

Create a kat object.

Member Summary

Public Members
public

The name of the torrent provider.

Private Members
private

The helper object for adding movies.

private

_kat: KatAPI

A configured KAT API.

private

The util object with general functions.

Method Summary

Public Methods
public

search(provider: Object): Array

Returns a list of all the inserted torrents.

Private Methods
private

_extractMovie(torrent: Object, language: String, regex: Regex): Object

Extract movie information based on a regex.

private

_getAllKATMovies(torrents: Array, language: String): Array

Puts all the found movies from the torrents in an array.

private

_getAllTorrents(totalPages: Integer, provider: Object): Array

Get all the torrents of a given provider.

private

_getMovie(katMovie: Object): Movie

Get all the movies.

private

_getMovieData(torrent: Object, language: String): Object

Get movie info from a given torrent.

Public Constructors

public constructor(name: String, debug: Boolean) source

Create a kat object.

Params:

NameTypeAttributeDescription
name String

The name of the torrent provider.

debug Boolean

Debug mode for extra output.

Public Members

public name: String source

The name of the torrent provider.

Private Members

private _helper: Helper source

The helper object for adding movies.

private _kat: KatAPI source

A configured KAT API.

See:

private _util: Util source

The util object with general functions.

Public Methods

Returns a list of all the inserted torrents.

Params:

NameTypeAttributeDescription
provider Object

The provider to query https://kat.cr/.

Return:

Array

A list of scraped movies.

Private Methods

private _extractMovie(torrent: Object, language: String, regex: Regex): Object source

Extract movie information based on a regex.

Params:

NameTypeAttributeDescription
torrent Object

The torrent to extract the movie information from.

language String

The language of the torrent.

regex Regex

The regex to extract the movie information.

Return:

Object

Information about a movie from the torrent.

private _getAllKATMovies(torrents: Array, language: String): Array source

Puts all the found movies from the torrents in an array.

Params:

NameTypeAttributeDescription
torrents Array

A list of torrents to extract movie information.

language String

The language of the torrent.

Return:

Array

A list of objects with movie information extracted from the torrents.

private _getAllTorrents(totalPages: Integer, provider: Object): Array source

Get all the torrents of a given provider.

Params:

NameTypeAttributeDescription
totalPages Integer

The total pages of the query.

provider Object

The provider to query https://kat.cr/.

Return:

Array

A list of all the queried torrents.

private _getMovie(katMovie: Object): Movie source

Get all the movies.

Params:

NameTypeAttributeDescription
katMovie Object

The movie information.

Return:

Movie

A movie.

private _getMovieData(torrent: Object, language: String): Object source

Get movie info from a given torrent.

Params:

NameTypeAttributeDescription
torrent Object

A torrent object to extract movie information from.

language String

The language of the torrent.

Return:

Object

Information about a movie from the torrent.