Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.79 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.79 KB

Nzb Build status

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.

Usage

Using the library couldn't be more simple. There are two methods to call:

  • NzbDocument.Load - Loads a document from the specified Stream, optionally using a specified Encoding.
  • NzbDocument.Parse - Parses a document from the specified string.

The library consists of four public types:

  1. NzbDocument - Represents an NZB document. This is the type returned from NzbDocument.Load or NzbDocument.Parse.
  2. NzbFile - Represents a file linked in the NZB document.
  3. NzbSegment - Represents one (of potentially many) segment(s) that makes up an NzbFile.

Example

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...
        }
    }
}