A tiny library for parsing NZB documents with .NET. The NZB Format Specification is available here.
The library is implemented using .NET Standard 1.0, with support for the following platforms (minimum):
- .NET Framework 4.5
- Windows 8
- Windows Phone 8.1
- Windows Phone Silverlight 8
- Xamarin.Android
- Xamarin.iOS
It is shipped as a NuGet package.
To install it, simply search for Nzb
in the Visual Studio Package Manager window, or write
Install-Package Nzb
In the Package Manager Console.
Using the library couldn't be more simple. There are two methods to call:
NzbDocument.Load
- Loads a document from the specifiedStream
, optionally using a specifiedEncoding
.NzbDocument.Parse
- Parses a document from the specifiedstring
.
The library consists of four public types:
NzbDocument
- Represents an NZB document. This is the type returned fromNzbDocument.Load
orNzbDocument.Parse
.NzbFile
- Represents a file linked in the NZB document.NzbSegment
- Represents one (of potentially many) segment(s) that makes up anNzbFile
.
Here's a quick example on how to use it (it's embarrassingly simple):
public static class Program
{
public static void Main(string[] args)
{
MainAsync(args).Wait();
}
public static async Task MainAsync(string[] args)
{
using (var documentStream = File.OpenRead("file.nzb"))
{
var document = await NzbDocument.Load(documentStream);
// Access document properties here...
}
}
}