pyload-client
v1.0.0
Published
A node wrapper module for pyLoad API
Downloads
6
Readme
pyload-client
Node.js pyLoad client, written in TypeScript based.
Installation
npm i --save pyload-client
Usage
const { PyloadClient } = require('pyload-client')
async function () {
const client = new PyloadClient({
apiUrl: 'https://my-pyload.com/api',
username: 'admin',
password: '12345678',
});
await client.connect();
const packageId = await client.addPackage({
name: 'my-package',
links: ['http://my-link.com/1', 'http://my-link.com/2'],
});
console.log(packageId);
const statusDownloads = await client.statusDownloads();
console.log(statusDownloads);
}
main()
.then(() => console.log('Done'))
.catch(err => console.error(err))
Implemented methods
Source : https://github.com/pyload/pyload/wiki/module.Api.Api
| Implemented | Name | Description | | ------------------ | ------------------------------------------------- | --------------------------------------------------------------------------------------------------- | | :white_check_mark: | addFiles(pid, links) | Adds files to specific package. | | :white_check_mark: | addPackage(name, links[, dest]) | Adds a package, with links to desired destination. | | :x: | call(info) | Calls a service (a method in hook plugin). | | :white_check_mark: | changePassword(user, oldpw, newpw) | changes password for specific user | | :white_check_mark: | checkAndAddPackages(links[, dest]) | Checks online status, retrieves names, and will add packages. | | :x: | checkAuth(username, password[, remoteip]) | Check authentication and returns details | | :white_check_mark: | checkOnlineStatus(urls) | initiates online status check | | :x: | checkOnlineStatusContainer(urls, container, data) | checks online status of urls and a submited container file | | :white_check_mark: | checkURLs(urls) | Gets urls and returns pluginname mapped to list of matches urls. | | :white_check_mark: | deleteFiles(fids) | Deletes several file entries from pyload. | | :white_check_mark: | deleteFinished() | Deletes all finished files and completly finished packages. | | :white_check_mark: | deletePackages(pids) | Deletes packages and containing links. | | :white_check_mark: | freeSpace() | Available free space at download directory in bytes | | :white_check_mark: | generateAndAddPackages(links[, dest]) | Generates and add packages | | :white_check_mark: | generatePackages(links) | Parses links, generates packages names from urls | | :white_check_mark: | getAccountTypes() | All available account types. | | :white_check_mark: | getAccounts(refresh) | Get information about all entered accounts. | | :white_check_mark: | getAllInfo() | Returns all information stored by hook plugins. | | :white_check_mark: | getAllUserData() | returns all known user and info | | :white_check_mark: | getCaptchaTask([exclusive]) | Returns a captcha task | | :white_check_mark: | getCaptchaTaskStatus(tid) | Get information about captcha task | | :white_check_mark: | getCollector() | same as getQueue for collector. | | :white_check_mark: | getCollectorData() | same as getQueueData for collector. | | :white_check_mark: | getConfig() | Retrieves complete config of core. | | :x: | getConfigDict() | Retrieves complete config in dict format, not for RPC. | | :white_check_mark: | getConfigValue(category, option[, section]) | Retrieve config value. | | :x: | getEvents(uuid) | Lists occured events, may be affected to changes in future. | | :white_check_mark: | getFileData(fid) | Get complete information about a specific file. | | :white_check_mark: | getFileOrder(pid) | Information about file order within package. | | :white_check_mark: | getInfoByPlugin(plugin) | Returns information stored by a specific plugin. | | :white_check_mark: | getLog([offset]) | Returns most recent log entries. | | :white_check_mark: | getPackageData(pid) | Returns complete information about package, and included files. | | :white_check_mark: | getPackageInfo(pid) | Returns information about package, without detailed information about containing files | | :white_check_mark: | getPackageOrder(destination) | Returns information about package order. | | :white_check_mark: | getPluginConfig() | Retrieves complete config for all plugins. | | :x: | getPluginConfigDict() | Plugin config as dict, not for RPC. | | :white_check_mark: | getQueue() | Returns info about queue and packages, not about files, see getQueueData or getPackageData instead. | | :white_check_mark: | getQueueData() | Return complete data about everything in queue, this is very expensive use it sparely. | | :white_check_mark: | getServerVersion() | pyLoad Core version | | :white_check_mark: | getServices() | A dict of available services, these can be defined by hook plugins. | | :white_check_mark: | getUserData(username, password) | similar to checkAuth but returns UserData thrift type | | :white_check_mark: | hasService(plugin, func) | Checks wether a service is available. | | :x: | isAuthorized(func, userdata) | checks if the user is authorized for specific method | | :white_check_mark: | isCaptchaWaiting() | Indicates wether a captcha task is available | | :white_check_mark: | isTimeDownload() | Checks if pyload will start new downloads according to time in config. | | :white_check_mark: | isTimeReconnect() | Checks if pyload will try to make a reconnect | | :white_check_mark: | kill() | Clean way to quit pyLoad | | :white_check_mark: | login(username, password[, remoteip]) | Login into pyLoad, this must be called when using rpc before any methods can be used. | | :white_check_mark: | moveFiles(fids, pid) | Move multiple files to another package | | :white_check_mark: | movePackage(destination, pid) | Set a new package location. | | :white_check_mark: | orderFile(fid, position) | Gives a new position to a file within its package. | | :white_check_mark: | orderPackage(pid, position) | Gives a package a new position. | | :white_check_mark: | parseURLs([html, url]) | Parses html content or any arbitaty text for links and returns result of | checkURLs | | :white_check_mark: | pauseServer() | Pause server: Tt wont start any new downloads, but nothing gets aborted. | | :x: | pollResults(rid) | Polls the result available for ResultID | | :white_check_mark: | pullFromQueue(pid) | Moves package from Queue to Collector. | | :white_check_mark: | pushToQueue(pid) | Moves package from Collector to Queue. | | :white_check_mark: | recheckPackage(pid) | Proofes online status of all files in a package, also a default action when | package is added. | | :white_check_mark: | removeAccount(plugin, account) | Remove account from pyload. | | :white_check_mark: | restart() | Restart pyload core | | :white_check_mark: | restartFailed() | Restarts all failed failes. | | :white_check_mark: | restartFile(fid) | Resets file status, so it will be downloaded again. | | :white_check_mark: | restartPackage(pid) | Restarts a package, resets every containing files. | | :white_check_mark: | setCaptchaResult(tid, result) | Set result for a captcha task | | :white_check_mark: | setConfigValue(category, option, value[, ...]) | Set new config value. | | :white_check_mark: | setPackageData(pid, data) | Allows to modify several package attributes. | | :white_check_mark: | setPackageName(pid, name) | Renames a package. | | :x: | setUserPermission(user, permission, role) | | | :white_check_mark: | statusDownloads() | Status off all currently running downloads. | | :white_check_mark: | statusServer() | Some general information about the current status of pyLoad. | | :white_check_mark: | stopAllDownloads() | Aborts all running downloads. | | :white_check_mark: | stopDownloads(fids) | Aborts specific downloads. | | :white_check_mark: | togglePause() | Toggle pause state. | | :white_check_mark: | toggleReconnect() | Toggle reconnect activation. | | :white_check_mark: | unpauseServer() | Unpause server: New Downloads will be started. | | :white_check_mark: | updateAccount(plugin, account[, password, ...]) | Changes pw/options for specific account. | | :x: | uploadContainer(filename, data) | Uploads and adds a container file to pyLoad. |