Newzbin:NZB Specs
From Newzbin Documentation
Contents |
[edit] Where's the simple stuff?
In our Guide to NZB Files.
[edit] NZB (Message-ID List) File Specification
Here follows a sample NZB for a single small file:
<?xml version="1.0" encoding="iso-8859-1" ?> <!DOCTYPE nzb PUBLIC "-//newzBin//DTD NZB 1.0//EN" "http://www.newzbin.com/DTD/nzb/nzb-1.0.dtd"> <nzb xmlns="http://www.newzbin.com/DTD/2003/nzb"> <file poster="Joe Bloggs <bloggs@nowhere.example>" date="1071674882" subject="Here's your file! abc-mr2a.r01 (1/2)"> <groups> <group>alt.binaries.newzbin</group> <group>alt.binaries.mojo</group> </groups> <segments> <segment bytes="102394" number="1">123456789abcdef@news.newzbin.com</segment> <segment bytes="4501" number="2">987654321fedbca@news.newzbin.com</segment> </segments> </file> </nzb>
This example is for one file, consisting of two segments, which are 102,394 bytes and 4,501 bytes. The file is posted into two groups, alt.binaries.newzbin and alt.binaries.mojo; it was posted by Joe Bloggs, at unixtime 1071674882. The subject is slightly munged; the segment counter always starts at 1; but you can see it has 2 segments; confirmed by the segments tags below.
This is a fully populated nzb file, all the tags and attributes you can expect to see are there, but clients are expected to cope should more be added.
Since this is an XML format, clients are encouraged to use an XML parser to process it; minor changes to the nzb files we generate such as with attribute ordering, indentation, and even new tags and attributes must be taken into account. XML PI's and CDATA sections are not expected to be used, so clients should be free to cut some corners using lightweight parsers.
We will, where possible, avoid changes which may break clients; even those which use simple pattern matchers. Significant changes to the format are unlikely at this point, but users of the format should try not to get too complacent.
[edit] XML Tag breakdown
| <nzb> .. </nzb> | Description | Root element for the file |
|---|---|---|
| Attributes | None | |
| Body | None (placeholder) | |
| Children | <file> | |
| <file> .. </file> | Description | Represents a list of messageids that make up a file |
| Attributes |
|
|
| Body | None (placeholder) | |
| Children | <groups>, <segments> | |
| <groups> .. </groups> | Description | Placeholder element for a list of groups that reference the file |
| Attributes | None | |
| Body | None (placeholder) | |
| Children | <group> | |
| <group> .. </group> | Description | One <group> element represents a group, multiple may be used |
| Attributes | None | |
| Body | string - The name of the group (e.g. alt.binaries.newzbin) | |
| Children | None | |
| <segments> .. </segments> | Description | Placeholder element for a list of segments that make up a file |
| Attributes | None | |
| Body | None (placeholder) | |
| Children | <segment> | |
| <segment> .. </segment> | Description | One part segment of a file |
| Attributes |
|
|
| Body | string - The Message-ID of this article, without the surrounding < and > (e.g. 123456789abcdef@news.newzbin.com) | |
| Children | None |
[edit] Who can use them?
Anyone. If you write a newsreader, feel free to add support for it. If you run a site, feel free to offer them for any file you want to point people at. This is an open standard, which anyone can use.