Skip to content

Streams and Subtitles

github-actions[bot] edited this page Aug 2, 2026 · 2 revisions

Streams and subtitles

Load a Media instance before requesting a stream:

using var client = new Client("https://your-mirror.example");
using var media = await client.GetAsync(mediaPath, cancellationToken);

The media page itself can exist while its player is temporarily unavailable or has been removed. Inspect the state before displaying player controls:

if (!media.Playback.IsAvailable)
{
    Console.WriteLine(media.Playback.Reason ?? "Playback is unavailable");
    return;
}

Calling a stream or episode method in this state throws PlaybackUnavailableException. Loading the media page still succeeds so the application can display its metadata

Movies

For a movie, season and episode are not required:

var stream = await media.GetStreamAsync(
    cancellationToken: cancellationToken);

Select a translation by numeric ID or exact name:

var byId = await media.GetStreamAsync(
    translation: "56",
    cancellationToken: cancellationToken);

var byName = await media.GetStreamAsync(
    translation: "Дубляж",
    cancellationToken: cancellationToken);

Without an explicit translation, the library tries candidates in configured priority order; see Configuration

Series

Both season and episode are required:

var stream = await media.GetStreamAsync(
    season: 1,
    episode: 5,
    cancellationToken: cancellationToken);

See Series and episodes for catalog discovery and complete-season loading

Qualities and URLs

Videos exposes only qualities currently available:

foreach (var pair in stream.Videos)
{
    Console.WriteLine(pair.Key);

    foreach (var url in pair.Value)
    {
        Console.WriteLine(url);
    }
}

Compatible player responses can contain a primary URL and one or more fallbacks that can point to direct MP4 files or HLS playlists

Find an available quality by full label or a case-insensitive fragment:

var urls720p = stream.GetUrls("720");
var ultraUrls = stream.GetUrls("Ultra");

Qualities includes protected metadata as well:

foreach (var quality in stream.Qualities.Values)
{
    Console.WriteLine(
        $"{quality.Name}: " +
        $"Premium={quality.RequiresPremium}, " +
        $"Available={quality.IsAvailable}");
}

When a quality requires Premium but the current account is not confirmed as Premium, its Urls list is empty, it is excluded from Videos, and GetUrls throws PremiumRequiredException

Player metadata

Console.WriteLine(stream.Name);
Console.WriteLine(stream.Season);
Console.WriteLine(stream.Episode);
Console.WriteLine(stream.TranslatorId);
Console.WriteLine(stream.DefaultQuality);
Console.WriteLine(stream.DefaultSubtitle);
Console.WriteLine(stream.ThumbnailPreview);
Console.WriteLine(stream.IsPremiumContent);
Console.WriteLine(stream.AccountTier);

Optional player fields can be null when the website omits them

Subtitles

Inspect all subtitle tracks:

foreach (var subtitle in stream.Subtitles.Items.Values)
{
    Console.WriteLine(
        $"{subtitle.Language}: {subtitle.Title}{subtitle.Url}");
}

Resolve a subtitle by language code, displayed title, or zero-based position:

var byCode = stream.Subtitles.GetUrl("en");
var byTitle = stream.Subtitles.GetUrl("English");
var first = stream.Subtitles.GetUrl(0);

GetUrl((string?)null) returns null, while an unknown language or title throws ArgumentException; an invalid position throws ArgumentOutOfRangeException

Override translator order for one call

var stream = await media.GetStreamAsync(
    season: 1,
    episode: 5,
    preferred: [111, 56],
    nonPreferred: [238],
    cancellationToken: cancellationToken);

The per-call lists do not mutate the media or client defaults

Clone this wiki locally