npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

doodstream

v1.0.3

Published

A simple API client for interacting with Doodstream, including file uploads, account management, and more.

Downloads

2,193

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:

  1. Visit the DoodStream website.
  2. Sign up for a new account.
  3. 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

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:

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:

| 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:

| 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:

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:

| 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:

| 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:

| 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:

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:

| 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:

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:

| 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:

| 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:

| 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:

| 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:

| 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:

| 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:

| 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:

| 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:

| 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:

| 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:

| 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

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). |