diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..94f0b01 --- /dev/null +++ b/404.html @@ -0,0 +1,461 @@ + + + +
+ + + + + + + + + + + + + + + + + + +
NZBException
+
+
+
+ Bases: Exception
Base exception for all nzb exceptions
+ + +
InvalidNZBError
+
+
+InvalidNZBError(message: str)
+
+ Bases: NZBException
Invalid NZB
+ +src/nzb/_exceptions.py
NZBMetaEditor
+
+
+Initialize the NZBMetaEditor instance.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
nzb |
+
+ str
+ |
+
+
+
+ NZB content as a string. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ Encoding of the NZB content, defaults to |
+
+ 'utf-8'
+ |
+
Raises:
+Type | +Description | +
---|---|
+ InvalidNZBError
+ |
+
+
+
+ Raised if the input is not valid XML. +However, being valid XML doesn't guarantee it's a correctly structured NZB. + |
+
src/nzb/_core.py
append
+
+
+append(*, title: str | None = None, passwords: Iterable[str] | str | None = None, tags: Iterable[str] | str | None = None, category: str | None = None) -> Self
+
Append metadata fields to the existing metadata in the NZB.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
title |
+
+ str
+ |
+
+
+
+ The title metadata field. + |
+
+ None
+ |
+
passwords |
+
+ Iterable[str] | str
+ |
+
+
+
+ Password(s) for the NZB file. + |
+
+ None
+ |
+
tags |
+
+ Iterable[str] | str
+ |
+
+
+
+ Tag(s) associated with the NZB file. + |
+
+ None
+ |
+
category |
+
+ str
+ |
+
+
+
+ Category of the NZB file. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ Returns itself. + |
+
src/nzb/_core.py
clear
+
+
+clear() -> Self
+
Clear all metadata fields from the NZB.
+ + +Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ Returns itself. + |
+
src/nzb/_core.py
from_file
+
+
+
+ classmethod
+
+
+Create an NZBMetaEditor instance from an NZB file path.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
nzb |
+
+ StrPath
+ |
+
+
+
+ File path to the NZB. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ Encoding of the NZB, defaults to |
+
+ 'utf-8'
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ Returns itself. + |
+
src/nzb/_core.py
remove
+
+
+Remove a metadata field from the NZB. +If the same field is present multiple times, this will remove them all.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
key |
+
+ Literal['title', 'password', 'tag', 'category'] | str
+ |
+
+
+
+ The metadata field to remove. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ Returns itself. + |
+
src/nzb/_core.py
save
+
+
+Save the edited NZB to a file.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
filename |
+
+ StrPath
+ |
+
+
+
+ Destination path for saving the NZB. +If not provided, uses the original file path if available. +This will also create the path if it doesn't exist already. + |
+
+ None
+ |
+
overwrite |
+
+ bool
+ |
+
+
+
+ Whether to overwrite the file if it exists, defaults to |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Path
+ |
+
+
+
+ The path to the saved file. + |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ If no filename is specified and the original file path is unknown. + |
+
+ FileExistsError
+ |
+
+
+
+ If the file exists and overwrite is |
+
src/nzb/_core.py
set
+
+
+set(*, title: str | None = None, passwords: Iterable[str] | str | None = None, tags: Iterable[str] | str | None = None, category: str | None = None) -> Self
+
Set metadata fields in the NZB. +This will also remove all existing metadata fields.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
title |
+
+ str
+ |
+
+
+
+ The title metadata field. + |
+
+ None
+ |
+
passwords |
+
+ Iterable[str] | str
+ |
+
+
+
+ Password(s) for the NZB file. + |
+
+ None
+ |
+
tags |
+
+ Iterable[str] | str
+ |
+
+
+
+ Tag(s) associated with the NZB file. + |
+
+ None
+ |
+
category |
+
+ str
+ |
+
+
+
+ Category of the NZB file. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ Returns itself. + |
+
src/nzb/_core.py
NZB
+
+
+
+ Bases: ParentModel
Represents a complete NZB file.
+ + + + +
file
+
+
+
+ cached
+ property
+
+
+file: File
+
The main content file (episode, movie, etc) in the NZB. +This is determined by finding the largest file in the NZB +and may not always be accurate.
+
files
+
+
+
+ instance-attribute
+
+
+File objects representing the files included in the NZB.
+
groups
+
+
+
+ cached
+ property
+
+
+Tuple of unique groups across all the files in the NZB.
+
meta
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Optional creator-definable metadata for the contents of the NZB.
+
names
+
+
+
+ cached
+ property
+
+
+Tuple of unique file names across all the files in the NZB. +May return an empty tuple if it fails to extract the name for every file.
+
par2_percentage
+
+
+
+ cached
+ property
+
+
+par2_percentage: float
+
Percentage of the size of all the .par2
files relative to the total size.
par2_size
+
+
+
+ cached
+ property
+
+
+par2_size: ByteSize
+
Total size of all the .par2
files.
posters
+
+
+
+ cached
+ property
+
+
+Tuple of unique posters across all the files in the NZB.
+
size
+
+
+
+ cached
+ property
+
+
+size: ByteSize
+
Total size of all the files in the NZB.
+
stems
+
+
+
+ cached
+ property
+
+
+Tuple of unique file stems (basename) across all the files in the NZB. +May return an empty tuple if it fails to extract the stem for every file.
+
suffixes
+
+
+
+ cached
+ property
+
+
+Tuple of unique file extensions across all the files in the NZB. +May return an empty tuple if it fails to extract the extension for every file.
+
has_par2
+
+
+has_par2() -> bool
+
Return True
if there's at least one .par2
file in the NZB, False
otherwise.
has_rar
+
+
+has_rar() -> bool
+
Return True
if any file in the NZB is a .rar
file, False
otherwise.
is_obfuscated
+
+
+is_obfuscated() -> bool
+
Return True
if any file in the NZB is obfuscated, False
otherwise.
is_rar
+
+
+is_rar() -> bool
+
Return True
if all files in the NZB are .rar
files, False
otherwise.
Meta
+
+
+
+ Bases: ParentModel
Optional creator-definable metadata for the contents of the NZB.
+ + + + +
category
+
+
+
+ class-attribute
+ instance-attribute
+
+
+category: str | None = None
+
Category.
+
password
+
+
+
+ cached
+ property
+
+
+password: str | None
+
Return the first password from Meta.passwords
+if it exists, None otherwise.
This is essentially just syntactic sugar for password = passwords[0] if passwords else None
+because although the spec allows multiple passwords, single passwords are far more common.
passwords
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Password(s).
+
tag
+
+
+
+ cached
+ property
+
+
+tag: str | None
+
The first tag from Meta.tags
+if it exists, None otherwise.
This is essentially just syntactic sugar for tag = tags[0] if tags else None
+because although the spec allows multiple tags, single tags are far more common.
tags
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Tag(s).
+
title
+
+
+
+ class-attribute
+ instance-attribute
+
+
+title: str | None = None
+
Title.
+
Segment
+
+
+
+ Bases: ParentModel
One part segment of a file.
+ + + + +
message_id
+
+
+
+ instance-attribute
+
+
+message_id: str
+
Message ID of the segment.
+
number
+
+
+
+ instance-attribute
+
+
+number: int
+
Number of the segment.
+
size
+
+
+
+ instance-attribute
+
+
+size: ByteSize
+
Size of the segment.
+
File
+
+
+
+ Bases: ParentModel
Represents a complete file, consisting of segments that make up a file.
+ + + + +
datetime
+
+
+
+ instance-attribute
+
+
+datetime: UTCDateTime
+
The date and time when the file was posted, in UTC.
+
groups
+
+
+
+ instance-attribute
+
+
+Groups that reference the file.
+
name
+
+
+
+ cached
+ property
+
+
+name: str
+
Complete name of the file with it's extension extracted from the subject. +May return an empty string if it fails to extract the name.
+
poster
+
+
+
+ instance-attribute
+
+
+poster: str
+
The poster of the file.
+
segments
+
+
+
+ instance-attribute
+
+
+Segments that make up the file.
+
size
+
+
+
+ cached
+ property
+
+
+size: ByteSize
+
Size of the file calculated from the sum of segment sizes.
+
stem
+
+
+
+ cached
+ property
+
+
+stem: str
+
Base name of the file without it's extension extracted from the File.name
.
+May return an empty string if it fails to extract the stem.
subject
+
+
+
+ instance-attribute
+
+
+subject: str
+
The subject of the file.
+
suffix
+
+
+
+ cached
+ property
+
+
+suffix: str
+
Extension of the file extracted from the File.name
.
+May return an empty string if it fails to extract the extension.
is_obfuscated
+
+
+is_obfuscated() -> bool
+
is_par2
+
+
+is_par2() -> bool
+
is_rar
+
+
+is_rar() -> bool
+
NZBParser
+
+
+Initialize the NZBParser.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
nzb |
+
+ str
+ |
+
+
+
+ NZB content as a string. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ Encoding of the NZB content. + |
+
+ 'utf-8'
+ |
+
src/nzb/_core.py
from_file
+
+
+
+ classmethod
+
+
+Create an NZBParser instance from an NZB file path.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
nzb |
+
+ StrPath
+ |
+
+
+
+ File path to the NZB. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ Encoding of the NZB, defaults to |
+
+ 'utf-8'
+ |
+
Returns:
+Type | +Description | +
---|---|
+ NZBParser
+ |
+
+
+
+ An NZBParser instance initialized with the content of the specified NZB file. + |
+
src/nzb/_core.py
parse
+
+
+parse() -> NZB
+
Parse the NZB.
+ + +Returns:
+Type | +Description | +
---|---|
+ NZB
+ |
+
+
+
+ NZB object representing the parsed NZB file. + |
+
Raises:
+Type | +Description | +
---|---|
+ InvalidNZBError
+ |
+
+
+
+ Raised if the input is not valid NZB. + |
+
src/nzb/_core.py
StrPath
+
+
+
+ module-attribute
+
+
+String or pathlib.Path
+
UTCDateTime
+
+
+
+ module-attribute
+
+
+UTCDateTime = Annotated[datetime, AfterValidator(lambda dt: astimezone(utc))]
+
datetime that's always in UTC.
+