invidious

package module
v0.0.0-...-8645f7b Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 3 Imported by: 0

README

go-invidious

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	APIVersion = "v1"

	EndpointInvidious = "https://invidio.us"

	EndpointAPI         = EndpointInvidious + "/api/" + APIVersion
	EndpointAnnotations = EndpointAPI + "/annotations"
	EndpointCaptions    = EndpointAPI + "/captions"
	EndpointComments    = EndpointAPI + "/comments"
	EndpointInsights    = EndpointAPI + "/insights"
	EndpointMixes       = EndpointAPI + "/mixes"
	EndpointPlaylists   = EndpointAPI + "/playlists"
	EndpointPopular     = EndpointAPI + "/popular"
	EndpointStats       = EndpointAPI + "/stats"
	EndpointTop         = EndpointAPI + "/top"
	EndpointTrending    = EndpointAPI + "/trending"
	EndpointVideos      = EndpointAPI + "/videos"

	EndpointChannels         = EndpointAPI + "/channels"
	EndpointChannelComments  = EndpointChannels + "/comments"
	EndpointChannelPlaylists = EndpointChannels + "/playlists"
	EndpointChannelSearch    = EndpointChannels + "/search"
	EndpointChannelVideos    = EndpointChannels + "/videos"

	EndpointSearch            = EndpointAPI + "/search"
	EndpointSearchSuggestions = EndpointSearch + "/suggestions"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Language string
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Search

func (client *Client) Search(query string) ([]*SearchResult, error)

type SearchQuery

type SearchQuery struct {
	Query    string `json:"q"`
	Language string `json:"hl"`
}

type SearchResult

type SearchResult struct {
	Type            string             `json:"type"`
	Title           string             `json:"title"`
	VideoID         string             `json:"videoId"`
	Author          string             `json:"author"`
	AuthorID        string             `json:"authorId"`
	AuthorURL       string             `json:"authorUrl"`
	VideoThumbnails []*VideoThumbnails `json:"videoThumbnails"`
	Description     string             `json:"description"`
	DescriptionHTML string             `json:"descriptionHtml"`
	ViewCount       int                `json:"viewCount"`
	Published       int                `json:"published"`
	PublishedText   string             `json:"publishedText"`
	LengthSeconds   int                `json:"lengthSeconds"`
	LiveNow         bool               `json:"liveNow"`
	Paid            bool               `json:"paid"`
	Premium         bool               `json:"premium"`
}

func (*SearchResult) InvidiousURL

func (result *SearchResult) InvidiousURL() string

func (*SearchResult) YouTubeURL

func (result *SearchResult) YouTubeURL() string

type SearchResults

type SearchResults []*SearchResult

type VideoThumbnails

type VideoThumbnails struct {
	Quality string `json:"quality"`
	URL     string `json:"url"`
	Width   int    `json:"width"`
	Height  int    `json:"height"`
}

Jump to

Keyboard shortcuts

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