helper

Utility helper functions for TeraBox API requests
Description:
  • Utility helper functions for TeraBox API requests
Source:

Methods

(inner) getChunkSize(fileSize, is_vip) → {integer}

Description:
  • Calculate proper chunk size for upload process
Source:
Parameters:
Name Type Default Description
fileSize integer File size in bytes
is_vip Boolean true VIP user flag
Returns:
Calculated chunk size
Type
integer

(async, inner) hashFile(filePath) → {Object}

Description:
  • Calculate hashes for specific local file
Source:
Parameters:
Name Type Description
filePath string Path to local file
Returns:
Calculated hashes for specific local file
Type
Object

(async, inner) uploadChunks(app, data, maxTasks, maxTries) → {Object}

Description:
  • Helper function for uploading chunks to TeraBox
Source:
Parameters:
Name Type Default Description
app TeraBoxApp File size in bytes
data Object Upload data parameters
maxTasks integer 10 maximum task for uploading
maxTries integer 5 maximum tries for chunk uploading
Returns:
Upload data parameters and status
Type
Object

(inner) unwrapErrorMessage(err) → {Object}

Description:
  • Helper function unwraping Error Message
Source:
Parameters:
Name Type Description
err Object Error object
Returns:
Error data
Type
Object