extractor

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRegistry = NewRegistry()

DefaultRegistry is the global extractor registry

Functions

This section is empty.

Types

type Extractor

type Extractor interface {
	// Name returns the unique name of the extractor
	Name() string

	// Hosts returns the list of hosts that this extractor supports
	Hosts() []string

	// Extract extracts media from the given URL
	Extract(ctx context.Context, url string) (*models.Media, error)
}

Extractor defines the interface that all media extractors must implement

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry manages all registered extractors

func GetRegistry

func GetRegistry() *Registry

GetRegistry returns the default extractor registry

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new extractor registry

func (*Registry) GetAllExtractors

func (r *Registry) GetAllExtractors() []Extractor

GetAllExtractors returns all registered extractors

func (*Registry) GetByHost

func (r *Registry) GetByHost(host string) (Extractor, bool)

GetByHost returns an extractor that handles the given host

func (*Registry) GetByName

func (r *Registry) GetByName(name string) (Extractor, bool)

GetByName returns an extractor by its name

func (*Registry) GetByURL

func (r *Registry) GetByURL(rawURL string) (Extractor, error)

GetByURL parses the URL and returns the appropriate extractor

func (*Registry) GetSupportedHosts

func (r *Registry) GetSupportedHosts() []string

GetSupportedHosts returns all supported hosts

func (*Registry) GetSupportedSources

func (r *Registry) GetSupportedSources() []models.MediaSource

GetSupportedSources returns all registered media sources

func (*Registry) Register

func (r *Registry) Register(ext Extractor) error

Register adds an extractor to the registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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