server

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Unlicense Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DISNEY_ACTIVITY = "com.disney.disneyplus/com.bamtechmedia.dominguez.main.MainActivity"
View Source
const DISNEY_APP_NAME = "com.disney.disneyplus"
View Source
const DISNEY_PLAYING_ACTIVITY = "com.disney.disneyplus/com.bamtechmedia.dominguez.player.ui.experiences.legacy.v1.TvPlaybackActivity"
View Source
const SPOTIFY_ACTIVITY = "com.spotify.tv.android/com.spotify.tv.android.SpotifyTVActivity"
View Source
const SPOTIFY_APP_NAME = "com.spotify.tv.android"
View Source
const TWITCH_ACTIVITY = "tv.twitch.android.viewer/tv.twitch.starshot64.app.StarshotActivity"
View Source
const TWITCH_APP_NAME = "tv.twitch.android.viewer"
View Source
const YOUTUBE_ACTIVITY = "com.amazon.firetv.youtube/dev.cobalt.app.MainActivity"
View Source
const YOUTUBE_APP_NAME = "com.amazon.firetv.youtube"

Variables

This section is empty.

Functions

func HandleLogin

func HandleLogin(context *fiber.Ctx) error

POST http://localhost:5950/admin/login

func HandleLogout

func HandleLogout(context *fiber.Ctx) error

func RenderHomePage

func RenderHomePage(context *fiber.Ctx) error

func RenderLoginPage

func RenderLoginPage(context *fiber.Ctx) error

func SanitizeUsername

func SanitizeUsername(first_name string, last_name string) (username string)

weak attempt at sanitizing form input to build a "username"

func ServeLoginPage

func ServeLoginPage(context *fiber.Ctx) error

Types

type Server

type Server struct {
	FiberApp *fiber.App          `yaml:"fiber_app"`
	Config   types.ConfigFile    `yaml:"config"`
	DB       *redis.Client       `yaml:"-"`
	ADB      adb_wrapper.Wrapper `json:"-"`
	TV       *tv.TV              `json:"-"`
	Status   Status              `json:"-"`
}
var GlobalServer *Server

func New

func New(db *redis.Client, config types.ConfigFile) (server Server)

func (*Server) ADBConnect

func (s *Server) ADBConnect() (connection adb_wrapper.Wrapper)

func (*Server) ADBNext

func (s *Server) ADBNext()

func (*Server) ADBPause

func (s *Server) ADBPause()

func (*Server) ADBPlay

func (s *Server) ADBPlay()

func (*Server) ADBPrevious

func (s *Server) ADBPrevious()

func (*Server) ADBStop

func (s *Server) ADBStop()

func (*Server) DisneyContinuousOpen

func (s *Server) DisneyContinuousOpen()

func (*Server) DisneyMovie added in v1.0.8

func (s *Server) DisneyMovie(c *fiber.Ctx) error

func (*Server) DisneyMovieNext

func (s *Server) DisneyMovieNext(c *fiber.Ctx) error

func (*Server) DisneyMoviePrevious

func (s *Server) DisneyMoviePrevious(c *fiber.Ctx) error

func (*Server) DisneyReopenApp

func (s *Server) DisneyReopenApp()

func (*Server) Get

func (s *Server) Get(key string) (result string)

func (*Server) GetJSON

func (s *Server) GetJSON(key string, target interface{})

var test = &types.ConfigFile{} s.GetJSON( "config" , test ) fmt.Println( test.BoltDBEncryptionKey ) https://redis.io/commands/json.get/

func (*Server) GetStatus

func (s *Server) GetStatus() (result Status)

func (*Server) GetStatusUrl

func (s *Server) GetStatusUrl(c *fiber.Ctx) error

func (*Server) GetTwitchLiveUpdate

func (s *Server) GetTwitchLiveUpdate(c *fiber.Ctx) error

func (*Server) GetYouTubeLiveUpdate

func (s *Server) GetYouTubeLiveUpdate(c *fiber.Ctx) error

func (*Server) Log

func (s *Server) Log(message string)

func (*Server) LogRequest

func (s *Server) LogRequest(context *fiber.Ctx) error

func (*Server) Next

func (s *Server) Next(c *fiber.Ctx) error

func (*Server) Pause

func (s *Server) Pause(c *fiber.Ctx) error

func (*Server) Play

func (s *Server) Play(c *fiber.Ctx) error

func (*Server) Previous

func (s *Server) Previous(c *fiber.Ctx) error

func (*Server) Printf

func (s *Server) Printf(format_string string, args ...interface{})

func (*Server) Set

func (s *Server) Set(key string, value interface{}) (result string)

func (*Server) SetupAdminRoutes

func (s *Server) SetupAdminRoutes()

func (*Server) SetupPublicRoutes

func (s *Server) SetupPublicRoutes()

func (*Server) SetupRoutes

func (s *Server) SetupRoutes()

func (*Server) SpotifyContinuousOpen

func (s *Server) SpotifyContinuousOpen()

func (*Server) SpotifyGetActiveButtonIndex

func (s *Server) SpotifyGetActiveButtonIndex() (result int)

func (*Server) SpotifyIsShuffleOn

func (s *Server) SpotifyIsShuffleOn() (result bool)

func (*Server) SpotifyNextPlaylist

func (s *Server) SpotifyNextPlaylist()

func (*Server) SpotifyNextPlaylistWithShuffle

func (s *Server) SpotifyNextPlaylistWithShuffle(c *fiber.Ctx) error

func (*Server) SpotifyNextSong

func (s *Server) SpotifyNextSong(song_id string)

func (*Server) SpotifyPlaylist

func (s *Server) SpotifyPlaylist(c *fiber.Ctx) error

func (*Server) SpotifyPlaylistWithShuffle

func (s *Server) SpotifyPlaylistWithShuffle(c *fiber.Ctx) error

func (*Server) SpotifyPressPreviousButton

func (s *Server) SpotifyPressPreviousButton()

func (*Server) SpotifyPreviousPlaylist

func (s *Server) SpotifyPreviousPlaylist(playlist_id string)

func (*Server) SpotifyPreviousSong

func (s *Server) SpotifyPreviousSong(song_id string)

func (*Server) SpotifyReopenApp

func (s *Server) SpotifyReopenApp()

func (*Server) SpotifySetShuffle

func (s *Server) SpotifySetShuffle(c *fiber.Ctx) error

func (*Server) SpotifyShuffleOff

func (s *Server) SpotifyShuffleOff() (was_on bool)

func (*Server) SpotifyShuffleOn

func (s *Server) SpotifyShuffleOn() (was_on bool)

func (*Server) SpotifySong

func (s *Server) SpotifySong(c *fiber.Ctx) error

5Muvh0ooAJkSgBylFyI3su

func (*Server) SpotifyUpdate

func (s *Server) SpotifyUpdate()

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop(c *fiber.Ctx) error

func (*Server) StoreLibrary

func (s *Server) StoreLibrary()

func (*Server) TVGetInput

func (s *Server) TVGetInput(c *fiber.Ctx) error

func (*Server) TVGetVolume

func (s *Server) TVGetVolume(c *fiber.Ctx) error

func (*Server) TVMuteOff

func (s *Server) TVMuteOff(c *fiber.Ctx) error

func (*Server) TVMuteOn

func (s *Server) TVMuteOn(c *fiber.Ctx) error

func (*Server) TVPowerOff

func (s *Server) TVPowerOff(c *fiber.Ctx) error

func (*Server) TVPowerOn

func (s *Server) TVPowerOn(c *fiber.Ctx) error

func (*Server) TVPowerStatus

func (s *Server) TVPowerStatus(c *fiber.Ctx) error

func (*Server) TVPrepare

func (s *Server) TVPrepare(c *fiber.Ctx) error

func (*Server) TVSetInput

func (s *Server) TVSetInput(c *fiber.Ctx) error

func (*Server) TVSetVolume

func (s *Server) TVSetVolume(c *fiber.Ctx) error

func (*Server) TwitchContinuousOpen

func (s *Server) TwitchContinuousOpen()

func (*Server) TwitchLiveNext

func (s *Server) TwitchLiveNext(c *fiber.Ctx) error

func (*Server) TwitchLivePrevious

func (s *Server) TwitchLivePrevious(c *fiber.Ctx) error

func (*Server) TwitchLiveUpdate

func (s *Server) TwitchLiveUpdate() (result []string)

Update DB With List of Currated Live Followers

func (*Server) TwitchRefreshAuthToken

func (s *Server) TwitchRefreshAuthToken() (access_token string)

func (*Server) TwitchReopenApp

func (s *Server) TwitchReopenApp()

func (*Server) YouTubeContinuousOpen

func (s *Server) YouTubeContinuousOpen()

func (*Server) YouTubeGetChannelId

func (s *Server) YouTubeGetChannelId(channel_name string) (result string)

or just goto dev console on youtube channel's /stream page and run `ytInitialData.metadata.channelMetadataRenderer.externalId`

func (*Server) YouTubeGetChannelsLiveVideos

func (s *Server) YouTubeGetChannelsLiveVideos(channel_id string) (result []YoutubeVideo)

https://developers.google.com/youtube/v3/docs/search/list

func (*Server) YouTubeIsVideoIdAvailable

func (s *Server) YouTubeIsVideoIdAvailable(video_id string) (result bool)

func (*Server) YouTubeLiveNext

func (s *Server) YouTubeLiveNext(c *fiber.Ctx) error

func (*Server) YouTubeLivePrevious

func (s *Server) YouTubeLivePrevious(c *fiber.Ctx) error

func (*Server) YouTubeLiveUpdate

func (s *Server) YouTubeLiveUpdate() (result []string)

Update DB With List of Currated Live Followers fucking idiots with this god damn quota. bro

func (*Server) YouTubeReopenApp

func (s *Server) YouTubeReopenApp()

func (*Server) YouTubeVideo

func (s *Server) YouTubeVideo(c *fiber.Ctx) error

type Status

type Status struct {
	StartTime                        string        `json:"start_time"`
	StartTimeOBJ                     time.Time     `json:"-"`
	PreviousPlayerName               string        `json:"previous_player_name"`
	PreviousPlayerCommand            string        `json:"previous_player_command"`
	PreviousStartTime                string        `json:"previous_start_time"`
	PreviousStartTimeOBJ             time.Time     `json:"-"`
	PreviousStartTimeDuration        time.Duration `json:"-"`
	PreviousStartTimeDurationSeconds float64       `json:"previous_start_time_duration_seconds"`
	// ADBTopWindow string `json:"adb_top_window"`
	// ADBVolume int `json:"adb_volume"`
	ADB adb_wrapper.Status `json:"adb"`
	TV  tv.Status          `json:"tv"`
}

type YouTubeResponseItem

type YouTubeResponseItem struct {
	Id struct {
		VideoId string `json:"videoId"`
	} `json:"id"`
	Snippet struct {
		Title string `json:"title"`
	} `json:"snippet"`
}

type YoutubeResponse

type YoutubeResponse struct {
	Items []YouTubeResponseItem `json:"items"`
}

type YoutubeVideo

type YoutubeVideo struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type YoutubeVideoInfo

type YoutubeVideoInfo struct {
	Items []struct {
		ID string `json:"id"`
	} `json:"items"`
}

Jump to

Keyboard shortcuts

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