yts-client

0.1.12 • Public • Published

yts-client

yts api for client

NPM

note

compative with yts api version 2

yts api version 2 document yts-api-v2-doc

using for synchronous yts database with other database, so almost yts api has removed because they not neccessary or work not stable

installation

# install by node package manager 
npm install yts-client

usage

import yts client module

var YtsClient = require('yts-client');

create an instance of yts client

// use default yts api url
var ytsClient = new YtsClient();
 
// use custom yts api url
// using when yts change api url, not change api params and response
var api = {
    find: <string>,
    findById: <string>
};
var ytsClient = new YtsClient(api);

find item by selector

var selector = {
    pageIndex: <number>, // [1, 50]
    pageSize: <number> ,
    quality: <string>, // 720p, 1080p, 3D
    rating_min: <number>, // [0, 9]
    term: <string>, // match with name, actorm director
    genre: <string>,
    sort_by: <string>,
    order_by: <string>, // desc, asc
};
ytsClient.find(selector, function(error, items) {});

find item by identity

var id = <number>;
ytsClient.findById(id, function(error, item) {});

count number of item match with selector

var selector = {}; // same as find item by selector
ytsClient.size(selector, function(error, size) {});

next api

all api is stable, no big change will apply

development

# clone from github.com 
# require ssh-key, please contact with owner to get one 
git clone git@github.com:thelordofthetimes/yts-client.git
cd yts-client
 
# install dependency modules 
npm install
 
# run test 
npm test
 
# write code and more... 
 
# update revision system control 
git add .
git commit -am '<message>' 
git push

Readme

Keywords

Package Sidebar

Install

npm i yts-client

Weekly Downloads

3

Version

0.1.12

License

BSD

Last publish

Collaborators

  • thelordofthetimes