doodstream
v1.0.3
Published
A simple API client for interacting with Doodstream, including file uploads, account management, and more.
Downloads
158
Maintainers
Readme
About DoodStream
DoodStream is a video hosting service where you can upload videos, share them with others, and monetize your content. It's an excellent platform for content creators to host and distribute videos while earning money.
There are no bandwidth limitations on DoodStream, meaning you can upload and share as many videos as you want without worrying about bandwidth restrictions.
How to Get an API Key
To use the features of this package, you will need a DoodStream API key. If you don't have one yet, you can sign up and get your API key by following these steps:
- Visit the DoodStream website.
- Sign up for a new account.
- Once registered, go to Settings section, you'll find your API Key.
Once you have your API key, you can start using the DoodStream API with this package!
Support me
Classes
Doodstream
Kind: global class
- About DoodStream
- How to Get an API Key
- Support me
- Classes
- Doodstream
- new Doodstream()
- new Doodstream(apiKey)
- doodstream.accountInfo() ⇒ Promise.<Object>
- doodstream.accountReports([options]) ⇒ Promise.<Object>
- doodstream.dmcaList([options]) ⇒ Promise.<Object>
- doodstream.uploadUrl() ⇒ Promise.<Object>
- doodstream.localUpload(filePath) ⇒ Promise.<Object>
- doodstream.cloneVideo(fileCode, [options]) ⇒ Promise.<Object>
- doodstream.remoteAdd(url, [options]) ⇒ Promise.<Object>
- doodstream.remoteList() ⇒ Promise.<Object>
- doodstream.remoteStatus(fileCode) ⇒ Promise.<Object>
- doodstream.remoteSlots() ⇒ Promise.<Object>
- doodstream.remoteActions(restartErrors, [options]) ⇒ Promise.<Object>
- doodstream.createFolder(name, [options]) ⇒ Promise.<Object>
- doodstream.renameFolder(folderId, name) ⇒ Promise.<Object>
- doodstream.listFolder(folderId, [options]) ⇒ Promise.<Object>
- doodstream.listFiles([options]) ⇒ Promise.<Object>
- doodstream.fileStatus(fileCode) ⇒ Promise.<Object>
- doodstream.fileInfo(fileCode) ⇒ Promise.<Object>
- doodstream.fileImage(fileCode) ⇒ Promise.<Object>
- doodstream.renameFile(fileCode, title) ⇒ Promise.<Object>
- doodstream.moveFile(fileCode, folderId) ⇒ Promise.<Object>
- doodstream.searchFile(searchTerm) ⇒ Promise.<Object>
- DoodstreamError ⇐ Error
- Unauthorized ⇐ DoodstreamError
- NotFound ⇐ DoodstreamError
- UnsupportedMediaType ⇐ DoodstreamError
- Request
new Doodstream()
A class for interacting with the Doodstream API. This class includes methods for performing actions related to account info, file uploads, folder management, and other operations provided by the Doodstream API.
new Doodstream(apiKey)
Creates an instance of the Doodstream class with the provided API key. The API key will be used for authenticating requests to the Doodstream API.
| Param | Type | Description | | --- | --- | --- | | apiKey | string | The API key to authenticate with the Doodstream API. |
doodstream.accountInfo() ⇒ Promise.<Object>
Get basic information about the account associated with the provided API key.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the account information.
Throws:
- Unauthorized - If the API key is missing or invalid.
doodstream.accountReports([options]) ⇒ Promise.<Object>
Get reports of your account (default last 7 days).
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the account report data.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | Object | {} | The options for retrieving the account reports. | | [options.last] | number | | The number of days of reports to retrieve (optional, default is last 7 days). | | [options.fromDate] | string | | The start date for the report in YYYY-MM-DD format (optional). | | [options.toDate] | string | | The end date for the report in YYYY-MM-DD format (optional). |
doodstream.dmcaList([options]) ⇒ Promise.<Object>
Get a list of DMCA reported files (500 results per page).
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the DMCA reported files list.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | Object | {} | The options for retrieving the DMCA reported files list. | | [options.perPage] | number | | The number of results per page (optional, default is 500). | | [options.page] | number | | The page number for pagination (optional). |
doodstream.uploadUrl() ⇒ Promise.<Object>
Get the URL for uploading local files.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the upload URL for local files.
Throws:
- Unauthorized - If the API key is missing or invalid.
doodstream.localUpload(filePath) ⇒ Promise.<Object>
Upload local files to the server using the API.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the file upload.
Throws:
- NotFound - If the file at the specified path is not found.
- UnsupportedMediaType - If the provided path is not a valid file.
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | filePath | string | The file path of the local file to upload. |
doodstream.cloneVideo(fileCode, [options]) ⇒ Promise.<Object>
Copy or clone your own or another user's file.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the clone operation.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | fileCode | string | | The file code of the file to clone. | | [options] | Object | {} | Optional parameters for the cloning process. | | [options.folderId] | string | | The folder ID where the file will be copied to (optional). |
doodstream.remoteAdd(url, [options]) ⇒ Promise.<Object>
Upload files using direct links.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the upload operation.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | url | string | | The URL of the file to upload. | | [options] | Object | {} | Optional parameters for the upload. | | [options.folderId] | string | | The folder ID where the file will be uploaded to (optional). | | [options.newTitle] | string | | The new title to set for the uploaded file (optional). |
doodstream.remoteList() ⇒ Promise.<Object>
Get the list of remote uploads and their status.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the list of remote uploads and their status.
Throws:
- Unauthorized - If the API key is missing or invalid.
doodstream.remoteStatus(fileCode) ⇒ Promise.<Object>
Get the status of a remote upload.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the status of the remote upload.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | fileCode | string | The file code of the file to check the status for. |
doodstream.remoteSlots() ⇒ Promise.<Object>
Get the total and used remote upload slots.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the total and used remote upload slots.
Throws:
- Unauthorized - If the API key is missing or invalid.
doodstream.remoteActions(restartErrors, [options]) ⇒ Promise.<Object>
Perform various actions on remote uploads.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the remote upload action.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | restartErrors | boolean | | Whether to restart all errors (required). | | [options] | Object | {} | Optional parameters for performing actions. | | [options.clearErrors] | boolean | | Whether to clear all errors (optional). | | [options.clearAll] | boolean | | Whether to clear all (optional). | | [options.deleteCode] | string | | The file code to delete a transfer (optional). |
doodstream.createFolder(name, [options]) ⇒ Promise.<Object>
Create a new folder.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the folder creation.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | name | string | | The name of the folder to create (required). | | [options] | Object | {} | Optional parameters for the folder creation. | | [options.parentId] | string | | The ID of the parent folder where the new folder will be created (optional). |
doodstream.renameFolder(folderId, name) ⇒ Promise.<Object>
Rename an existing folder.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the folder renaming operation.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | folderId | string | The ID of the folder to rename (required). | | name | string | The new name for the folder (required). |
doodstream.listFolder(folderId, [options]) ⇒ Promise.<Object>
List all folders within a specified folder.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the list of folders.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | folderId | string | | The ID of the folder whose contents (subfolders) will be listed (required). | | [options] | Object | {} | Optional parameters for listing the folders. | | [options.onlyFolders] | boolean | | Whether to list only folders (optional). |
doodstream.listFiles([options]) ⇒ Promise.<Object>
List all files with optional filters.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the list of files.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | Object | {} | Optional parameters for listing the files. | | [options.page] | number | | The page number for pagination (optional). | | [options.perPage] | number | | The maximum number of videos per page (maximum 200, optional). | | [options.folderId] | string | | The ID of the folder to list files from (optional). | | [options.created] | string | | Show files uploaded after a specified timestamp or within X minutes ago (optional). |
doodstream.fileStatus(fileCode) ⇒ Promise.<Object>
Check the status of a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the status of the file.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | fileCode | string | The file code of the file to check the status for (required). |
doodstream.fileInfo(fileCode) ⇒ Promise.<Object>
Get detailed information about a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the file information.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | fileCode | string | The file code of the file to retrieve information for (required). |
doodstream.fileImage(fileCode) ⇒ Promise.<Object>
Get the splash, single, or thumbnail image of a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the file's image data.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | fileCode | string | The file code of the file to retrieve the image for (required). |
doodstream.renameFile(fileCode, title) ⇒ Promise.<Object>
Rename a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the file renaming operation.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | fileCode | string | The file code of the file to rename (required). | | title | string | The new name for the file (required). |
doodstream.moveFile(fileCode, folderId) ⇒ Promise.<Object>
Move a file from one folder to another.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the result of the file move operation.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | fileCode | string | The file code of the file to move (required). | | folderId | string | The ID of the folder to move the file to (required). Use 0 to move to the root directory. |
doodstream.searchFile(searchTerm) ⇒ Promise.<Object>
Search for files using a specified search term.
Kind: instance method of Doodstream
Returns: Promise.<Object> - - A promise that resolves to the search results.
Throws:
- Unauthorized - If the API key is missing or invalid.
| Param | Type | Description | | --- | --- | --- | | searchTerm | string | The term to search for in the files (required). |
DoodstreamError ⇐ Error
Kind: global class
Extends: Error
new DoodstreamError(code, message)
Custom error class that extends the built-in Error class. Represents a general error for the Doodstream application.
| Param | Type | Description | | --- | --- | --- | | code | string | The error code associated with the error. | | message | string | The error message describing the error. |
Unauthorized ⇐ DoodstreamError
Kind: global class
Extends: DoodstreamError
new Unauthorized(code, message)
Custom error class for unauthorized access, extends DoodstreamError. Represents an error when the user is not authorized to perform a given action.
| Param | Type | Description | | --- | --- | --- | | code | string | The error code associated with the unauthorized error. | | message | string | The error message describing the unauthorized access. |
NotFound ⇐ DoodstreamError
Kind: global class
Extends: DoodstreamError
new NotFound(code, message)
Custom error class for not found errors, extends DoodstreamError. Represents an error when the requested resource cannot be found.
| Param | Type | Description | | --- | --- | --- | | code | string | The error code associated with the not found error. | | message | string | The error message describing the missing resource. |
UnsupportedMediaType ⇐ DoodstreamError
Kind: global class
Extends: DoodstreamError
new UnsupportedMediaType(code, message)
Custom error class for unsupported media type errors, extends DoodstreamError. Represents an error when the media type of the request is unsupported by the server.
| Param | Type | Description | | --- | --- | --- | | code | string | The error code associated with the unsupported media type error. | | message | string | The error message describing the unsupported media type. |
Request
Kind: global class
- Request
- new Request()
- .get(url) ⇒ Promise.<Object>
- .post(url, [data], [headers]) ⇒ Promise.<Object>
new Request()
A class that provides utility methods for making HTTP requests using Axios. It includes methods for sending GET and POST requests, with handling for API key validation errors.
Request.get(url) ⇒ Promise.<Object>
Makes a GET request to the specified URL using Axios. If the response contains a specific error message related to the API key, an Unauthorized error is thrown.
Kind: static method of Request
Returns: Promise.<Object> - - The data returned from the GET request.
Throws:
- Unauthorized - If no API key is provided or if the API key is invalid.
| Param | Type | Description | | --- | --- | --- | | url | string | The URL to send the GET request to. |
Request.post(url, [data], [headers]) ⇒ Promise.<Object>
Makes a POST request to the specified URL using Axios. If the response contains a specific error message related to the API key, an Unauthorized error is thrown.
Kind: static method of Request
Returns: Promise.<Object> - - The data returned from the POST request.
Throws:
- Unauthorized - If no API key is provided or if the API key is invalid.
| Param | Type | Default | Description | | --- | --- | --- | --- | | url | string | | The URL to send the POST request to. | | [data] | Object | {} | The data to send in the body of the POST request (optional). | | [headers] | Object | {} | The headers to include with the POST request (optional). |