Utility helper functions for TeraBox API requests
Methods
(inner) getChunkSize(fileSize, is_vip) → {integer}
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}
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}
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}
Parameters:
Name | Type | Description |
---|---|---|
err |
Object | Error object |
Returns:
Error data
- Type
- Object