TiktokExplode.Extensions.DependencyInjection 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TiktokExplode.Extensions.DependencyInjection --version 1.1.0
                    
NuGet\Install-Package TiktokExplode.Extensions.DependencyInjection -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TiktokExplode.Extensions.DependencyInjection" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TiktokExplode.Extensions.DependencyInjection" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="TiktokExplode.Extensions.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TiktokExplode.Extensions.DependencyInjection --version 1.1.0
                    
#r "nuget: TiktokExplode.Extensions.DependencyInjection, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TiktokExplode.Extensions.DependencyInjection@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TiktokExplode.Extensions.DependencyInjection&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=TiktokExplode.Extensions.DependencyInjection&version=1.1.0
                    
Install as a Cake Tool

TiktokExplode.Extensions.DependencyInjection

NuGet .NET License: MIT

Microsoft.Extensions.DependencyInjection integration for TiktokExplode.

Provides AddTiktokExplode() — a fluent extension method on IServiceCollection that registers IVideoClient and ISearchClient, and lets you choose between the Playwright (default) or HTTP fetcher strategy.


Installation

dotnet add package TiktokExplode.Extensions.DependencyInjection

Usage

// Default — Playwright fetcher, all defaults
services.AddTiktokExplode();

// Playwright with a visible browser window (useful for debugging)
services.AddTiktokExplode(b => b
    .UsePlaywrightFetcher(o => o.Headless = false));

// HTTP fetcher — no browser dependency, lighter footprint
// Note: ISearchClient is NOT registered with this strategy (requires Playwright)
services.AddTiktokExplode(b => b
    .UseHttpFetcher(o => o.WarmupDelay = TimeSpan.Zero)
    .ConfigureTiktok(o => o.MaxWafRetries = 5));

Then inject IVideoClient or ISearchClient normally:

public class MyService(IVideoClient client, ISearchClient search)
{
    public async Task<string> GetTitleAsync(string url)
    {
        var video = await client.GetVideoAsync(url);
        return video.Description;
    }

    public async IAsyncEnumerable<string> SearchTitlesAsync(string keyword)
    {
        await foreach (var video in search.SearchAsync(keyword))
            yield return video.Description;
    }
}

Registered services

Service Implementation Lifetime Fetcher
IVideoClient TiktokClient Singleton Both
ISearchClient TiktokSearchClient Singleton Playwright only
IPageFetcher PlaywrightFetcher or HttpFetcher Singleton Both
ISearchFetcher PlaywrightSearchFetcher Singleton Playwright only
TikTokOptions Singleton Both
PlaywrightFetcherOptions or HttpFetcherOptions Singleton Both

Important: ISearchClient and ISearchFetcher are only registered when using the Playwright fetcher. TikTok's search API requires a real browser to sign requests — it cannot be replicated with plain HTTP. If you call UseHttpFetcher() and attempt to inject ISearchClient, the DI container will throw a resolution error at runtime.


Builder API

Method Description
ConfigureTiktok(Action<TikTokOptions>?) Configures WAF retry count and base delay
UsePlaywrightFetcher(Action<PlaywrightFetcherOptions>?) Uses a real Chromium browser via Playwright (default). Also registers ISearchClient and ISearchFetcher
UseHttpFetcher(Action<HttpFetcherOptions>?) Uses a plain HttpClient — faster start, may be WAF-blocked. ISearchClient is not available

Note: UsePlaywrightFetcher and UseHttpFetcher are mutually exclusive — the last one called wins.


Package Description
TiktokExplode Domain layer — models, interfaces, exceptions
TiktokExplode.Infrastructure HTTP + Playwright fetchers, parser, download client
TiktokExplode.All Meta-package — installs domain + infrastructure together

License

MIT — see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.2 116 6/20/2026
1.2.1 108 6/19/2026
1.1.0 107 6/12/2026
1.0.0 105 5/20/2026