npm.io
1.0.3 • Published 4 years ago

uptobox-ts

Licence
MIT
Version
1.0.3
Deps
2
Size
30 kB
Vulns
23
Weekly
0
Stars
1

Uptobox-TS

MIT License NPM Version Author

A Node library allowing to use uptobox APIs easily.

Installation

Use the package manager npm to install.

npm install uptobox-ts

Usage

import { UptoboxApi, Uptobox } from 'uptobox-ts';

Quick Example

Download a file
import { UptoboxApi, Uptobox } from 'uptobox-ts';

Uptobox.setToken(TOKEN); // User token provided by Uptobox

// Will download the file (premium or non-premium) in the current folder
await uptobox.downloadFile('https://uptobox.com/XXXXXXXXXXXX')
Get the remaining time to download
import { UptoboxApi, Uptobox } from 'uptobox-ts';

// Will return the remaining time for account's users
await uptobox.getRemainingTime('https://uptobox.com/XXXXXXXXXXXX')
// Will return the remaining time for guest users
await uptobox.getRemainingTime('https://uptobox.com/XXXXXXXXXXXX', false)

APIs

getWaitingToken
import { UptoboxApi } from 'uptobox-ts';

// Password is optionnal
await UptoboxApi.getWaitingToken(token, fileCode, password?)

Premium users get the download link directly

import { UptoboxApi } from 'uptobox-ts';

// For non-premium users
await UptoboxApi.getDownloadLink(token, fileCode, waitingToken)
getFilesInfo
import { UptoboxApi } from 'uptobox-ts';

await UptoboxApi.getFilesInfo(fileCodeOne, fileCodeTwo, ...);
getUserData
import { UptoboxApi } from 'uptobox-ts';

await UptoboxApi.getUserData(token);

Features

  • Download a file
  • Retrieve the remaining time for the download
  • More features to come in the future
APIs checklist

License

Distributed under the MIT License. See LICENSE for more information.

Keywords