Skip to content

stylesuxx/yts.to

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yts.to API wrapper

Build pass Dependencies

This is a JavaScript wrapper for the yts.to API that returns promises.

Calls to the classes methods return promises. All API functionality is wrapped. The parameters for the methods are the mandatory fields. Where optional fields may be passed this may be done via options object. For optional parameters please refer to the yts.to API documentation. JSON is returned directly as the API returns it. The interesting content is in the data field of the response.

Installation

npm install yts.to --save

Usage example

var YTS = require('yts.to');
var yts = new YTS();

yts.findMovie('Snatch', {with_rt_ratings: true}).then( function(movies) {
  console.log(movies);
});

Available methods

The YTS class provides the following methods:

public accessible endpoints

  • findMovie(searchString, options = {})
  • getDetails(movieId, options = {})
  • getSuggestions(movieId)
  • getComments(movieId)
  • getReviews(movieId)
  • getParentalGuides(movieId)
  • getUpcoming()
  • getUserDetails(userId, options = {})

Require application and/or user key

  • getUserKey(username, password, applicationId)
  • getUserProfile(userKey)
  • editUserSettings(userKey, applicationKey, options = {})
  • registerUser(applicationKey, username, password, email)
  • forgotPassword(applicationKey, email)
  • resetPassword(resetCode, newPassword, applicationKey)
  • likeMovie(userKey, movieId, applicationKey)
  • getBookmarks(userKey, options = {})
  • addBookmark(userKey, movieId, applicationKey)
  • deleteBookmark(userKey, movieId, applicationKey)
  • makeComment(userKey, movieId, commentText, applicationKey)
  • likeComment(userKey, commentId, applicationKey)
  • reportComment(userKey, commentId, applicationKey)
  • deleteComment(userKey, commentId, applicationKey)
  • makeRequest(userKey, movieTitle, applicationKey, options = {})

Testing

An extensive test suite is provided and may be invoked by running:

npm run test

About

NPM module for the yts.to API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published