Table of Contents

Interface IWebDownloadsClient

Namespace
TorBoxSDK.Main.WebDownloads
Assembly
TorBoxSDK.dll

Defines operations for managing web downloads through the TorBox Main API.

public interface IWebDownloadsClient

Methods

AsyncCreateWebDownloadAsync(CreateWebDownloadRequest, CancellationToken)

Creates a new web download with asynchronous server-side processing.

Task<TorBoxResponse<WebDownload>> AsyncCreateWebDownloadAsync(CreateWebDownloadRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateWebDownloadRequest

The web download creation request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<WebDownload>>

The created web download details.

Exceptions

ArgumentNullException

Thrown when request is null.

TorBoxException

Thrown when the API returns an error.

CheckCachedAsync(IReadOnlyList<string>, CheckCachedOptions?, CancellationToken)

Checks whether one or more web download hashes are cached on TorBox (GET).

Task<TorBoxResponse<CheckWebCached>> CheckCachedAsync(IReadOnlyList<string> hashes, CheckCachedOptions? options = null, CancellationToken cancellationToken = default)

Parameters

hashes IReadOnlyList<string>

The list of hashes to check for cache availability.

options CheckCachedOptions

Optional cache check parameters.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<CheckWebCached>>

The cache status data.

Exceptions

ArgumentNullException

Thrown when hashes is null.

TorBoxException

Thrown when the API returns an error.

CheckCachedByPostAsync(CheckWebCachedRequest, CancellationToken)

Checks whether one or more web download hashes are cached on TorBox (POST).

Task<TorBoxResponse<CheckWebCached>> CheckCachedByPostAsync(CheckWebCachedRequest request, CancellationToken cancellationToken = default)

Parameters

request CheckWebCachedRequest

The cache check request containing hashes and options.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<CheckWebCached>>

The cache status data.

Exceptions

ArgumentNullException

Thrown when request is null.

TorBoxException

Thrown when the API returns an error.

ControlWebDownloadAsync(ControlWebDownloadRequest, CancellationToken)

Performs a control operation on a web download.

Task<TorBoxResponse> ControlWebDownloadAsync(ControlWebDownloadRequest request, CancellationToken cancellationToken = default)

Parameters

request ControlWebDownloadRequest

The control operation request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse>

The API response.

Exceptions

ArgumentNullException

Thrown when request is null.

TorBoxException

Thrown when the API returns an error.

CreateWebDownloadAsync(CreateWebDownloadRequest, CancellationToken)

Creates a new web download from a URL.

Task<TorBoxResponse<WebDownload>> CreateWebDownloadAsync(CreateWebDownloadRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateWebDownloadRequest

The web download creation request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<WebDownload>>

The created web download details.

Exceptions

ArgumentNullException

Thrown when request is null.

TorBoxException

Thrown when the API returns an error.

EditWebDownloadAsync(EditWebDownloadRequest, CancellationToken)

Edits the properties of an existing web download.

Task<TorBoxResponse> EditWebDownloadAsync(EditWebDownloadRequest request, CancellationToken cancellationToken = default)

Parameters

request EditWebDownloadRequest

The edit request containing the new property values.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse>

The API response.

Exceptions

ArgumentNullException

Thrown when request is null.

TorBoxException

Thrown when the API returns an error.

GetHostersAsync(CancellationToken)

Retrieves the list of supported hosters and their status.

Task<TorBoxResponse<IReadOnlyList<Hoster>>> GetHostersAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<IReadOnlyList<Hoster>>>

A list of supported hosters.

Exceptions

TorBoxException

Thrown when the API returns an error.

GetMyWebDownloadListAsync(GetMyListOptions?, CancellationToken)

Retrieves the authenticated user's web download list.

Task<TorBoxResponse<IReadOnlyList<WebDownload>>> GetMyWebDownloadListAsync(GetMyListOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options GetMyListOptions

Optional query parameters for filtering and pagination.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<IReadOnlyList<WebDownload>>>

A list of web downloads.

Exceptions

TorBoxException

Thrown when the API returns an error.

RequestDownloadAsync(long, RequestWebDownloadOptions?, CancellationToken)

Requests a download link for a web download.

Task<TorBoxResponse<string>> RequestDownloadAsync(long webId, RequestWebDownloadOptions? options = null, CancellationToken cancellationToken = default)

Parameters

webId long

The unique identifier of the web download.

options RequestWebDownloadOptions

Optional download request options.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<string>>

The download URL as a string.

Exceptions

TorBoxException

Thrown when the API returns an error.