NW.MetaLinks
1.0.0
dotnet add package NW.MetaLinks --version 1.0.0
NuGet\Install-Package NW.MetaLinks -Version 1.0.0
<PackageReference Include="NW.MetaLinks" Version="1.0.0" />
<PackageVersion Include="NW.MetaLinks" Version="1.0.0" />
<PackageReference Include="NW.MetaLinks" />
paket add NW.MetaLinks --version 1.0.0
#r "nuget: NW.MetaLinks, 1.0.0"
#:package NW.MetaLinks@1.0.0
#addin nuget:?package=NW.MetaLinks&version=1.0.0
#tool nuget:?package=NW.MetaLinks&version=1.0.0
NW.MetaLinks
NW.MetaLinks is a library that creates MetaLink v4 strings from user-provided URLs and their corresponding filenames for delegating downloads to external applications such as JDownloader.
Getting Started
If /home/nw.metalinks is the folder in which the .nupkg file is located, you can install it using this command:
dotnet add package NW.MetaLinks --source /home/nw.metalinks
The Typical Use Case
In order to use the library, the first thing we need to do is to create a list of download URLs and a list containing their corresponding filenames, and then pass them to the CreateMetaLink4 method of a MetaLinkFactory object, as shown in the following example:
using System;
using System.Collections.Generic;
using System.IO;
using NW.MetaLinks;
...
List<Uri> urls = new List<Uri>() {
new Uri("https://example.com/files/document.pdf"),
new Uri("https://example.com/files/archive.zip")
};
List<string> fileNames = new List<string>() {
"document.pdf",
"archive.zip"
};
IMetaLinkFactory factory = new MetaLinkFactory();
string metaLink = factory.CreateMetaLink4(
packageName: "My Package",
urls: urls,
fileNames: fileNames
);
File.WriteAllText(
path: "my-package.metalink",
contents: metaLink
);
...
Note: urls and fileNames must contain the same number of items.
As alternative:
using System;
using System.Collections.Generic;
using NW.MetaLinks;
...
List<Tuple<Uri, string>> files = new List<Tuple<Uri, string>>() {
Tuple.Create(
new Uri("https://example.com/files/document.pdf"),
"document.pdf"
),
Tuple.Create(
new Uri("https://example.com/files/archive.zip"),
"archive.zip"
)
};
IMetaLinkFactory factory = new MetaLinkFactory();
string metaLink = factory.CreateMetaLink4(
packageName: "My Package",
files: files
);
MetaLink v4
Here is a minimal example of a MetaLink v4 file:
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink" version="4.0">
<identity>My Package Name</identity>
<file name="example.bin">
<url>https://example.com/example.bin</url>
</file>
</metalink>
Even if it's a XML file under the hood, a MetaLink file is expected to have the .metalink extension (instead of .xml).
MetaLink v4 and JDownloader
JDownloader has full support for the MetaLink v4 format, but it's worth mentioning that by default, once the user imports a MetaLink file, JDownloader will ping all the files inside it, to check for their online status.
When importing a MetaLink file with hundreds or thousands of links inside, could flood the website and bring the provider to blacklist your IP address.
Before importing a MetaLink file, it could be a good practice to disable the Do Link Check feature:
- Open JDownloader 2.
- Go to
Settings→Advanced Settings. - Locate the setting:
LinkCollector: Do Link Check - Untick (disable) this option.
- Done!
License
MIT
| 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 was computed. 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
- No dependencies.
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.0.0 | 100 | 8/2/2026 |