Home Manual Reference Source Test Repository
public class | source

YTS

Class for scraping movies from https://yts.ag/.

Constructor Summary

Public Constructor
public

Create a yts object for movie content.

Member Summary

Public Members
public

The name of the torrent provider.

Private Members
private

The helper object for adding movies.

private

The request object with added defaults.

private

The util object with general functions.

Method Summary

Public Methods
public

search(): Movie[]

Returns a list of all the inserted torrents.

Private Methods
private

Format data from movies.

private

All the found movies.

private

_getOnePage(page: Integer, retry: Boolean): Promise

Get formatted data from one page.

private

Get the total pages to go through.

Public Constructors

public constructor(name: String) source

Create a yts object for movie content.

Params:

NameTypeAttributeDescription
name String

The name of the content provider.

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 _request: Object source

The request object with added defaults.

private _util: Util source

The util object with general functions.

Public Methods

Returns a list of all the inserted torrents.

Return:

Movie[]

A list of scraped movies.

Private Methods

private _formatPage(data: Object): Object source

Format data from movies.

Params:

NameTypeAttributeDescription
data Object

Data about the movies.

Return:

Object

An object with the imdb id and the torrents.

private _getMovies(): Array source

All the found movies.

Return:

Array

A list of all the found movies.

private _getOnePage(page: Integer, retry: Boolean): Promise source

Get formatted data from one page.

Params:

NameTypeAttributeDescription
page Integer

The page to get the data from.

retry Boolean
  • optional
  • default: true

Retry the function.

Return:

Promise

Formatted data from one page.

private _getTotalPages(retry: Boolean): Promise source

Get the total pages to go through.

Params:

NameTypeAttributeDescription
retry Boolean
  • optional
  • default: true

Retry the request.

Return:

Promise

The maximum pages to go through.