plugin

package
v0.0.0-...-7b57e32 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

direct

follow location

plugins

repeater instead of providing the m3u8 content by ourselves, repeater use http 302 to redirect clients to the original url so further requests will be fired to us

youtube

youtube

Index

Constants

View Source
const (
	DefaultUserAgent string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
)

Variables

View Source
var (
	NoMatchPlugin error = errors.New("No matching plugin found")
	NoMatchFeed   error = errors.New("This channel is not currently live")
)

Functions

func GetPluginList

func GetPluginList() []string

Types

type ChannalProvider

type ChannalProvider interface {
	Channels(parentChannel *model.Channel, liveInfo *model.LiveInfo) []*model.Channel
}

type DirectM3U8Parser

type DirectM3U8Parser struct{}

func (*DirectM3U8Parser) Parse

func (p *DirectM3U8Parser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string, content io.Reader) (*model.LiveInfo, error)

func (*DirectM3U8Parser) Transform

func (p *DirectM3U8Parser) Transform(req *http.Request, info *model.LiveInfo) error

func (*DirectM3U8Parser) TransformTs

func (p *DirectM3U8Parser) TransformTs(rawLink string, tsLink string, info *model.LiveInfo) string

type FeedHost

type FeedHost interface {
	Host(c *gin.Context, info *model.LiveInfo) error
}

host a live feed directly instead of generating a m3u8 playlist

type Forger

type Forger interface {
	ForgeM3U8(info *model.LiveInfo) (baseUrl string, body string, err error)
}

Allow a plugin to generate a custom M3U8 playlist instead of requesting from the internet

type HealthCheck

type HealthCheck interface {
	Check(content string, info *model.LiveInfo) error
}

do a healthcheck when GetM3U8Content returned

type M3UParser

type M3UParser struct{}

func (*M3UParser) Channels

func (p *M3UParser) Channels(parentChannel *model.Channel, liveInfo *model.LiveInfo) (channels []*model.Channel)

channel provider

func (*M3UParser) Parse

func (p *M3UParser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (*model.LiveInfo, error)

type M3UPlayList

type M3UPlayList struct {
	Channels []ParsedChannel
}

type M3URepeater

type M3URepeater struct {
	M3UParser
}

func (*M3URepeater) Channels

func (p *M3URepeater) Channels(parentChannel *model.Channel, liveInfo *model.LiveInfo) (channels []*model.Channel)

channel provider

type ParsedChannel

type ParsedChannel struct {
	ID       int
	Name     string
	URL      string
	Proxy    bool
	TsProxy  string
	ProxyUrl string
	Category string
}

type Plugin

type Plugin interface {
	Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (info *model.LiveInfo, error error)
}

plugin parser interface

func GetPlugin

func GetPlugin(name string) (Plugin, error)

type RTMPParser

type RTMPParser struct {
	URLM3U8Parser
}

func (*RTMPParser) Host

func (p *RTMPParser) Host(c *gin.Context, info *model.LiveInfo) error

func (*RTMPParser) Parse

func (p *RTMPParser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (*model.LiveInfo, error)

type RepeaterParser

type RepeaterParser struct{}

func (*RepeaterParser) Host

func (p *RepeaterParser) Host(c *gin.Context, info *model.LiveInfo) error

func (*RepeaterParser) Parse

func (p *RepeaterParser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (*model.LiveInfo, error)

type Transformer

type Transformer interface {
	Transform(req *http.Request, info *model.LiveInfo) error
}

transform the request before getM3U8content

type TsTransformer

type TsTransformer interface {
	TransformTs(rawLink string, tsLink string, info *model.LiveInfo) string
}

transform the tsproxy link

type URLM3U8Parser

type URLM3U8Parser struct {
	DirectM3U8Parser
}

func (*URLM3U8Parser) Parse

func (p *URLM3U8Parser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (*model.LiveInfo, error)

type UrlInfo

type UrlInfo struct {
	Headers         map[string]string `json:"headers"`
	RedirectCounter int32             `json:"redir"`
}

type YoutubeExtraInfo

type YoutubeExtraInfo struct {
	LastUrl string
}

type YoutubeParser

type YoutubeParser struct{}

func (*YoutubeParser) Check

func (p *YoutubeParser) Check(content string, info *model.LiveInfo) error

func (*YoutubeParser) Parse

func (p *YoutubeParser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (*model.LiveInfo, error)

type YtDlpParser

type YtDlpParser struct{}

func (*YtDlpParser) Parse

func (p *YtDlpParser) Parse(liveUrl string, proxyUrl string, lastInfo string) (*model.LiveInfo, error)

Jump to

Keyboard shortcuts

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