yts-client
v0.1.12
Published
yts api for client
Downloads
31
Readme
yts-client
yts api for client
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 [email protected]: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