parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package parser extracts release metadata from torrent titles. Designed for scene/p2p naming conventions: e.g. "Show.S01E02.1080p.BluRay.x265-GROUP".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPlayable

func IsPlayable(title string, categoryID int, magnetURI string, resolution string) bool

IsPlayable retorna true se o player provavelmente consegue tocar este release. Magnet vazio → false. Rejeições duras (epub/zip/iso/ebook). Caso contrário usa allowlist de categorias/exts/hints com fallback "true" (preferir oferecer Play e deixar o decoder reclamar do que esconder).

Types

type MediaKind

type MediaKind string

MediaKind é "video" | "audio" | "other". "video" é o default quando o classificador não tem sinal claro — o <video> do PlayerModal toca áudio também, então não-perda; já o AudioBar não renderiza vídeo. Espelhe detectKind() do playable.ts.

const (
	KindVideo MediaKind = "video"
	KindAudio MediaKind = "audio"
	KindOther MediaKind = "other"
)

func DetectKind

func DetectKind(title string, categoryID int) MediaKind

DetectKind decide entre audio / video com base no título + categoria Jackett. Mesma ordem de fallback que o frontend usava (ext > category > hint > default).

type Quality

type Quality struct {
	Resolution string   `json:"resolution,omitempty"` // 480p, 720p, 1080p, 2160p, 4K
	Codec      string   `json:"codec,omitempty"`      // x265, x264, AV1
	Source     string   `json:"source,omitempty"`     // BluRay, WEB-DL, WEBRip, HDTV, CAM, TS, DVDRip
	Audio      []string `json:"audio,omitempty"`      // DTS, EAC3, TrueHD, AC3, Atmos, AAC
	Group      string   `json:"group,omitempty"`      // YIFY, RARBG, etc.
	Year       int      `json:"year,omitempty"`       // detected release year
	Season     int      `json:"season,omitempty"`     // S__ when matched
	Episode    int      `json:"episode,omitempty"`    // E__ when matched
	HDR        bool     `json:"hdr,omitempty"`
	DolbyVis   bool     `json:"dv,omitempty"`
	TenBit     bool     `json:"tenBit,omitempty"`
	Repack     bool     `json:"repack,omitempty"`
	Proper     bool     `json:"proper,omitempty"`
	Extended   bool     `json:"extended,omitempty"`
	Remux      bool     `json:"remux,omitempty"`
	Multi      bool     `json:"multi,omitempty"` // multi-audio
	Dubbed     bool     `json:"dubbed,omitempty"`
	Subbed     bool     `json:"subbed,omitempty"`
}

Quality holds parsed release metadata. Empty fields mean "not detected".

func Parse

func Parse(title string) Quality

Parse extracts what it can from a release title. Always returns a value (never nil).

Jump to

Keyboard shortcuts

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