ArgonFetch.Abstractions
1.0.1
dotnet add package ArgonFetch.Abstractions --version 1.0.1
NuGet\Install-Package ArgonFetch.Abstractions -Version 1.0.1
<PackageReference Include="ArgonFetch.Abstractions" Version="1.0.1" />
<PackageVersion Include="ArgonFetch.Abstractions" Version="1.0.1" />
<PackageReference Include="ArgonFetch.Abstractions" />
paket add ArgonFetch.Abstractions --version 1.0.1
#r "nuget: ArgonFetch.Abstractions, 1.0.1"
#:package ArgonFetch.Abstractions@1.0.1
#addin nuget:?package=ArgonFetch.Abstractions&version=1.0.1
#tool nuget:?package=ArgonFetch.Abstractions&version=1.0.1
ArgonFetch.Abstractions
Everything you need to write an ArgonFetch source plugin, and nothing else.
yt-dlp is what fetches things the ordinary way. A plugin exists for links that need something else first: one that has to become a different link before anything can be downloaded, one that lists a collection, or one that a separate piece of code fetches on its own.
[assembly: ArgonFetchPlugin("example", ArgonFetchPluginAttribute.CurrentAbi, Name = "Example")]
public sealed class ExampleProvider : ISourceProvider
{
public string Id => "example";
public bool CanHandle(Uri url) => url.Host.EndsWith("example.com");
public async Task<ProviderOutcome> PrepareAsync(Uri url, IProviderContext ctx, CancellationToken ct)
{
var real = await FindRealUrl(url, ctx, ct);
return ProviderOutcome.Rewrite(real, new MediaTags("Title", "Artist"));
}
}
Reference this without shipping it
<PackageReference Include="ArgonFetch.Abstractions" Version="1.0.0" ExcludeAssets="runtime" />
ExcludeAssets="runtime" matters. The host loads this assembly and hands your plugin types from
its own copy. A plugin that carries its own copy gets a second, unrelated ISourceProvider, and
the load fails complaining that ISourceProvider cannot be cast to ISourceProvider.
Rules worth knowing before you write one
CanHandleis asked of every installed plugin on every request. Keep it to inspecting the URL: no network, no throwing, no waiting.- Return raw addresses in
MediaStream. Caching them, hiding them behind keys and building the URLs a client sees is the host's business, and it changes. - Cache through
IProviderContext.CacheKey, never a bare string - the cache is shared.
MIT licensed, so what you write with it is yours to license as you please.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.