yify-promise
This is a wrapper around the Yify api.
Installation
npm i -S yify-promise
Usage
There are three functions in this package: search
, details
and suggestions
. They all accept an object of options as one of their arguments. Below are the default values for the properties:
host: `https://yts.lt` listPath: `/api/v2/list_movies.json` detailsPath: `/api/v2/movie_details.json` suggestionsPath: `/api/v2/movie_suggestions.json` upcomingPath: `/api/v2/list_upcoming.json` createMagnets: false
This allows you to set the host and endpoints for the api. The createMagnets
flag will generate the magnet url for the torrent files. This is just a convenience as the url
property on the torrent is perfectly sufficient.
Search
There are multiple options for seaching. See the documentation on each option that's available.
const yify = const options = query_term: `star wars episode ii` yify
To attach the magnet urls to the torrent.magnet
property, pass the option in the second argument.
const options = query_term: `star wars episode ii` yify
Details
Fetches the details for a single movie based on the movie id.
const options = movie_id: 2860 // with_images: boolean, // with_cast: boolean yify
Suggestions
Fetches four suggestions based on a movie id.
yify