Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtractedFileInfo ¶
type FirstSegmentData ¶
type FirstSegmentData struct {
File *nzbparser.NzbFile // Reference to the NZB file (for groups, subject, metadata)
Headers nntppool.YEncMeta // yEnc headers (FileName, FileSize, PartSize)
RawBytes []byte // Up to 16KB of raw data for PAR2 detection (may be less if segment is smaller)
MissingFirstSegment bool // True if first segment download failed (article not found, etc.)
IsArticleNotFound bool // True only when 430 Not Found (permanent); false for timeouts/transient
OriginalIndex int // Original position in the parsed NZB file list
}
FirstSegmentData holds cached data from the first segment of an NZB file This avoids redundant fetching when both PAR2 extraction and file parsing need the same data
type ParsedFile ¶
type ParsedFile struct {
Subject string
Filename string
Size int64
Segments []*metapb.SegmentData
Groups []string
IsRarArchive bool
Is7zArchive bool
IsPar2Archive bool
Encryption metapb.Encryption // Encryption type (e.g., "rclone"), nil if not encrypted
Password string // Password from NZB meta, nil if not encrypted
Salt string // Salt from NZB meta, nil if not encrypted
ReleaseDate time.Time // Release date from the Usenet post
OriginalIndex int // Original position in the parsed NZB file list
NzbdavID string // Original ID from nzbdav (for backward compatibility)
AesKey []byte // AES encryption key (for nzbdav compatibility)
AesIv []byte // AES initialization vector (for nzbdav compatibility)
}
ParsedFile represents a file extracted from the NZB
type ParsedNzb ¶
type ParsedNzb struct {
Path string
Filename string
TotalSize int64
Type NzbType
Files []ParsedFile
SegmentsCount int
ExtractedFiles []ExtractedFileInfo
// contains filtered or unexported fields
}
ParsedNzb contains the parsed NZB data and extracted metadata
func (*ParsedNzb) GetPassword ¶
GetPassword returns the password for this NZB
func (*ParsedNzb) SetPassword ¶
SetPassword sets the password for this NZB
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles NZB file parsing
func (*Parser) GetMetadata ¶
GetMetadata extracts metadata from the NZB head section
func (*Parser) ParseFile ¶
func (p *Parser) ParseFile(ctx context.Context, r io.Reader, nzbPath string, progressTracker progress.ProgressTracker) (*ParsedNzb, error)
ParseFile parses an NZB file from a reader. progressTracker, if non-nil, receives incremental updates as first segments are fetched (the longest phase). It is safe to pass nil — updates are skipped.
func (*Parser) ValidateNzb ¶
ValidateNzb performs basic validation on the parsed NZB
type StrmParser ¶
type StrmParser struct {
// contains filtered or unexported fields
}
StrmParser handles STRM file parsing containing NXG links
func (*StrmParser) ParseStrmFile ¶
ParseStrmFile parses a STRM file containing an NXG link
func (*StrmParser) ValidateStrmFile ¶
func (p *StrmParser) ValidateStrmFile(parsed *ParsedNzb) error
ValidateStrmFile performs basic validation on the parsed STRM file