API to interact with subdb services
Node.js API library to query thesubdb.com
- All api methods are available through subdb.api attributes (see http://thesubdb.com/api/ for methods and arguments).
- A hash method helper is also available
For searching a sub file
var SubDb = require"subdb";var subdb = ;subdbcomputeHashpath_to_movieiferr return err;var hash = res;subdbapisearch_subtitleshashiferr return err;subdbapidownload_subtitlehash resjoin',' 'pathtosub.srt'iferr return err;// sub is normally fetched into pathtosub.srt;;;
For uploading a sub file
var SubDb = require"subdb";var subdb = ;subdbapiupload_subtitlehash subfileiferr return err;// sub subfile is normally uploaded to thesubdb.com servers;