Home Manual Reference Source Test Repository
public class | source

Extractor

Extends:

BaseExtractor → Extractor

Class for extracting movies from torrents.

Constructor Summary

Public Constructor
public

constructor(name: String, contentProvider: Object, debug: Boolean)

Create an extractor object for movie content.

Member Summary

Private Members
private

The helper object for adding movies.

private

The util object with general functions.

Method Summary

Public Methods
public

search(provider: Object): Movie[]

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

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

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

private

Get all the movies.

private

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

Get movie info from a given torrent.

Inherited Summary

From class BaseExtractor
public

The name of the torrent provider.

private

The content provider used by the extractor.

private

The util object with general functions.

private

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

Get all the torrents of a given provider.

Public Constructors

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

Create an extractor object for movie content.

Override:

BaseExtractor#constructor

Params:

NameTypeAttributeDescription
name String

The name of the content provider.

contentProvider Object

The content provider to extract content from.

debug Boolean
  • nullable: true

Debug mode for extra output.

Private Members

private _helper: Helper source

The helper object for adding movies.

private _util: Util source

The util object with general functions.

Override:

BaseExtractor#_util

Public Methods

Returns a list of all the inserted torrents.

Params:

NameTypeAttributeDescription
provider Object

The provider to query content provider.

Return:

Movie[]

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 _getAllMovies(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 _getMovie(movie: Object): Movie source

Get all the movies.

Params:

NameTypeAttributeDescription
movie 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.