Table of Contents

Interface IStreamClient

Namespace
TorBoxSDK.Main.Stream
Assembly
TorBoxSDK.dll

Defines operations for streaming content through the TorBox Main API.

public interface IStreamClient

Methods

CreateStreamAsync(long, long, string, CreateStreamOptions?, CancellationToken)

Creates a stream for a download item.

Task<TorBoxResponse<string>> CreateStreamAsync(long id, long fileId, string type, CreateStreamOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id long

The identifier of the download.

fileId long

The identifier of the file within the download.

type string

The type of download (e.g., torrent, usenet).

options CreateStreamOptions

Optional stream creation options for track indices.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<string>>

The stream URL or data as a string.

Exceptions

ArgumentNullException

Thrown when type is null.

ArgumentException

Thrown when type is empty.

TorBoxException

Thrown when the API returns an error.

GetStreamDataAsync(string, string, GetStreamDataOptions?, CancellationToken)

Gets stream data for a download item.

Task<TorBoxResponse<StreamData>> GetStreamDataAsync(string presignedToken, string token, GetStreamDataOptions? options = null, CancellationToken cancellationToken = default)

Parameters

presignedToken string

The presigned token for stream authentication.

token string

The authentication token.

options GetStreamDataOptions

Optional stream data options for track indices.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<StreamData>>

The stream data.

Exceptions

ArgumentNullException

Thrown when presignedToken or token is null.

ArgumentException

Thrown when presignedToken or token is empty.

TorBoxException

Thrown when the API returns an error.