TiktokExplode.Extensions.DependencyInjection
1.1.0
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
<PackageReference Include="TiktokExplode.Extensions.DependencyInjection" Version="1.1.0" />
<PackageVersion Include="TiktokExplode.Extensions.DependencyInjection" Version="1.1.0" />
<PackageReference Include="TiktokExplode.Extensions.DependencyInjection" />
paket add TiktokExplode.Extensions.DependencyInjection --version 1.1.0
#r "nuget: TiktokExplode.Extensions.DependencyInjection, 1.1.0"
#:package TiktokExplode.Extensions.DependencyInjection@1.1.0
#addin nuget:?package=TiktokExplode.Extensions.DependencyInjection&version=1.1.0
#tool nuget:?package=TiktokExplode.Extensions.DependencyInjection&version=1.1.0
TiktokExplode.Extensions.DependencyInjection
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:
ISearchClientandISearchFetcherare 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 callUseHttpFetcher()and attempt to injectISearchClient, 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:
UsePlaywrightFetcherandUseHttpFetcherare mutually exclusive — the last one called wins.
Related packages
| 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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.5)
- TiktokExplode (>= 1.2.0)
- TiktokExplode.Infrastructure (>= 1.2.0)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.5)
- TiktokExplode (>= 1.2.0)
- TiktokExplode.Infrastructure (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.