Home Manual Reference Source Repository
public class | source

KAT

Class for scraping shows 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 shows.

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

_extractShow(torrent: Object, regex: Regex, dateBased: Boolean): Object

Extract show information based on a regex.

private

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

private

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

Get all the torrents of a given provider.

private

_getShow(katShow: Object): Show

Get all the shows.

private

Get show 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 shows.

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 shows.

Private Methods

private _extractShow(torrent: Object, regex: Regex, dateBased: Boolean): Object source

Extract show information based on a regex.

Params:

NameTypeAttributeDescription
torrent Object

The torrent to extract the show information from.

regex Regex

The regex to extract the show information.

dateBased Boolean

Check for dateBased episodes.

Return:

Object

Information about a show from the torrent.

private _getAllKATShows(torrents: Array): Array source

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

Params:

NameTypeAttributeDescription
torrents Array

A list of torrents to extract show information.

Return:

Array

A list of objects with show 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 _getShow(katShow: Object): Show source

Get all the shows.

Params:

NameTypeAttributeDescription
katShow Object

The show information.

Return:

Show

A show.

private _getShowData(torrent: Object): Object source

Get show info from a given torrent.

Params:

NameTypeAttributeDescription
torrent Object

A torrent object to extract show information from.

Return:

Object

Information about a show from the torrent.