parser

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package parser reads release names: title, year, season and episode, resolution, source, codec and group.

Package parser extracts structured metadata from release filenames, using PTN-style logic as a base. It works by repeatedly matching and stripping known tokens (season/episode, quality, codec, group, edition, proper/repack) from the raw name; whatever is left before the first stripped token is the title candidate.

This does not import github.com/rdborg/mediarium/internal/download (or any other module) — the project's package-boundary rule keeps the parser usable standalone.

Index

Constants

View Source
const English = "English"

English is the name Languages uses for English, the language a release with no language tag is assumed to be in.

Variables

This section is empty.

Functions

func IsPreRelease

func IsPreRelease(source string) bool

IsPreRelease reports whether a source is a cinema recording or screener rather than a proper release.

func LanguageNames

func LanguageNames() []string

LanguageNames lists every language a release tag can name, English first and the rest alphabetically.

Types

type Release

type Release struct {
	Title      string
	Year       int
	Season     int   // 0 = not a TV release
	Episode    int   // 0 = season pack / not episode-specific
	Episodes   []int // populated for multi-episode releases (e.g. E01E02)
	Resolution string
	Source     string // WEB-DL, WEBRip, BluRay, REMUX, HDTV, DVDRip, CAM, ...
	Codec      string // x264, x265, XviD, ...
	AudioCodec string // AAC, AC3, DTS, TrueHD, Atmos, ...
	HDR        string // HDR10, HDR10+, DV
	Edition    string // Extended, Director's Cut, Unrated, IMAX, ...
	Group      string
	Proper     bool
	Repack     bool
	Is3D       bool
	// Languages are the audio languages the release name tags (English,
	// Italian...), each once. Empty means untagged, which is usually English.
	Languages []string
	// Multi is set when the release says it holds several audio languages
	// (MULTI, DUAL, or DL after a language).
	Multi bool
	// Subbed is set for releases tagged with subtitles (VOSTFR, SUBBED...).
	Subbed bool
}

Release is the structured result of parsing a release filename. Season/ Episode fields are zero for movie releases; they exist now (rather than being added in Phase 2) so the same struct serves both without a rework.

func Parse

func Parse(name string) Release

Parse extracts a Release from a raw filename or release title. The input need not have an extension; if present it's stripped first.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL