1.0.3 • Published 2 years ago
uptobox-ts v1.0.3
Uptobox-TS
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
getDownloadLink
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
- getWaitingToken
- getDownloadLink
- getFilesInfo
- getUserData
- enableSSLDownload
- enableDirectDownload
- enableSecurityLock
- convertPoint
- createVoucher
- getFolderContent
- getFilesAndFolders
- updateFileInfo
- updateFilesInfo
- moveFolder
- moveFiles
- copyFiles
- renameFolder
- createFolder
- deleteFiles
- deleteFolder
- getUploadLink
License
Distributed under the MIT License. See LICENSE for more information.