plugin

package
v0.0.0-...-5cc333d Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: GPL-3.0 Imports: 21 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

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 DirectM3U8Parser

type DirectM3U8Parser struct{}

func (*DirectM3U8Parser) Parse

func (p *DirectM3U8Parser) Parse(liveUrl string, proxyUrl string, previousExtraInfo string) (*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 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"`
}

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 YtDlpOAuthParser

type YtDlpOAuthParser struct{}

func (*YtDlpOAuthParser) ForgeM3U8

func (p *YtDlpOAuthParser) ForgeM3U8(info *model.LiveInfo) (baseUrl string, body string, err error)

func (*YtDlpOAuthParser) Parse

func (p *YtDlpOAuthParser) Parse(liveUrl string, proxyUrl string, lastInfo 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)

type YtVideoAudioInfo

type YtVideoAudioInfo struct {
	VideoUrl string
	AudioUrl string
}

Jump to

Keyboard shortcuts

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