streamerslive

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 8 Imported by: 0

README

streamerslive

Command-line tool and Go library to fetch streaming channels from Youtube or Twitch.

Installation

You can grab a binary from releases.

Commands

add

Adds channels with the provided URLs to the list displayed by list. Multiple URLs are divided by one or more spaces.

streamerslive add https://www.twitch.tv/harukakaribu https://www.twitch.tv/gamesdonequick https://www.youtube.com/channel/UCPZgBtMYoFKypEG2SCvBN9A
list

Displays saved streaming channels.

$ streamerslive list
+----+----------------+--------------------------------+
| ID |    CHANNEL     |          STREAM TITLE          |
+----+----------------+--------------------------------+
|  1 | arikacaribu    |                                |
|  2 | gamesdonequick | Awesome Games Done Quick 2021  |
|    |                | Online - Benefiting Prevent    |
|    |                | Cancer Foundation - Pokémon    |
|    |                | Platinum                       |
|  3 | rosedoodle     | 🌸「 😳 welcome to the COMFY   |
|    |                | zone 🌹💖|| beepu beepu!       |
|    |                | ✨」🌸【VTuber】               |
+----+----------------+--------------------------------+
remove

Removes a channel from list.

$ streamerslive remove 3
rosedoodle removed
watch

Opens stream in default browser.

streamerslive watch 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTwitchAPICredentials is the error thrown
	// when provided invalid Twitch API credentials
	ErrInvalidTwitchAPICredentials = errors.New("invalid Twitch API credentials")
	// ErrInvalidURL is the error thrown when URL is invalid
	ErrInvalidURL = errors.New("invalid URL")
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	URL  string
	Name string
	// Stream is nil when channel is not streaming
	Stream *Stream
}

Channel represents a Youtube or Twitch channel

func SortByName

func SortByName(cs []Channel) []Channel

SortByName returns a slice of channels sorted by name

type ChannelsClient

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

ChannelsClient provides the client instance to get streams info

func NewChannelsClient

func NewChannelsClient(twitchAPICredentials TwitchAPICredentials) *ChannelsClient

NewChannelsClient creates a new ChannelsClient instance with provided credentials

func (*ChannelsClient) ChannelFromURL

func (cc *ChannelsClient) ChannelFromURL(url string) (*Channel, error)

ChannelFromURL fetches a channel's information

type Stream

type Stream struct {
	Title string
	URL   string
}

Stream represents a YouTube or Twitch stream

type TwitchAPICredentials

type TwitchAPICredentials struct {
	ClientID       string
	AppAccessToken string
}

TwitchAPICredentials are required to get info from Twitch streams. Check https://dev.twitch.tv/docs/authentication

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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