stalker

package
v0.0.0-...-956d054 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Title    string             // Used for Proxy service to generate fake response to new URL request
	CMD      string             // channel's identifier in Stalker portal
	LogoLink string             // Link to logo
	Portal   *Portal            // Reference to portal from where this channel is taken from
	GenreID  string             // Stores genre ID (category ID)
	Genres   *map[string]string // Stores mappings for genre ID -> genre title

	CMD_ID    string // Used for Proxy service to generate fake response to new URL request
	CMD_CH_ID string // Used for Proxy service to generate fake response to new URL request
}

Channel stores information about channel in Stalker portal. This is not a real TV channel representation, but details on how to retrieve a working channel's URL.

func (*Channel) Genre

func (c *Channel) Genre() string

Genre returns a genre title

func (c *Channel) Logo() string

Logo returns full link to channel's logo

func (c *Channel) NewLink(retry bool) (string, error)

NewLink retrieves a link to the working channel. Retrieved link can be played in VLC or Kodi, but expires very soon if not being constantly opened (used).

type Config

type Config struct {
	Portal *Portal `yaml:"portal"`
	HLS    struct {
		Enabled bool   `yaml:"enabled"`
		Bind    string `yaml:"bind"`
	} `yaml:"hls"`
	Proxy struct {
		Enabled bool   `yaml:"enabled"`
		Bind    string `yaml:"bind"`
		Rewrite bool   `yaml:"rewrite"`
	} `yaml:"proxy"`
}

Config contains configuration taken from the YAML file.

func ReadConfig

func ReadConfig(path *string) (*Config, error)

ReadConfig returns configuration from the file in Portal object

type Portal

type Portal struct {
	Model        string `yaml:"model"`
	SerialNumber string `yaml:"serial_number"`
	DeviceID     string `yaml:"device_id"`
	DeviceID2    string `yaml:"device_id2"`
	Signature    string `yaml:"signature"`
	MAC          string `yaml:"mac"`
	Username     string `yaml:"username"`
	Password     string `yaml:"password"`
	Location     string `yaml:"url"`
	TimeZone     string `yaml:"time_zone"`
	Token        string `yaml:"token"`
}

Portal represents Stalker portal

func (*Portal) RetrieveChannels

func (p *Portal) RetrieveChannels() (map[string]*Channel, error)

RetrieveChannels retrieves all TV channels from stalker portal.

func (*Portal) Start

func (p *Portal) Start() error

Start connects to stalker portal, authenticates, starts watchdog etc.

Jump to

Keyboard shortcuts

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