Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • TorrentSearch

Index

Constructors

constructor

  • new TorrentSearch(appName: string, userAgent?: undefined | string, endpoint?: undefined | string): TorrentSearch
  • The search object

    Parameters

    • appName: string

      needed TorrentApi to identify the client

    • Optional userAgent: undefined | string

      in case the one we set stop workin (chrome vers. 60)

    • Optional endpoint: undefined | string

      if the end point change and we didn't update fast enough, you can change it here

    Returns TorrentSearch

Properties

Private _appName

_appName: string

Private _endpoint

_endpoint: string = "https://torrentapi.org/pubapi_v2.php"

Private _queue

_queue: PromiseThrottler = new PromiseThrottler(2000)

Private _token

_token: Token = Token.expired()

Private _userAgent

_userAgent: string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"

Accessors

delayBetweenRequests

delayBetweenRequests:

Change delay between each request

Only change this if you know what you're doing

Methods

Private _delayedRequest

  • The API is rate limited, be sure to only do the request in the right time to avoid hitting the rate limiting

    Type parameters

    • T

    Parameters

    Returns Promise<T>

Private _processRequest

  • Set all the query parameters for the request

    Check also for token expired

    Type parameters

    • T

    Parameters

    Returns Promise<T>

Private _request

Private ensureToken

  • ensureToken(): Promise<Token>

search

searchAdvanced

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc