youtube

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: OSL-3.0 Imports: 9 Imported by: 3

Documentation

Overview

YouTube

Index

Constants

View Source
const (
	Origin = "https://www.youtube.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseJS

type BaseJS struct {
	Cache  string
	Create string
}

func NewBaseJS

func NewBaseJS() (BaseJS, error)

func (BaseJS) Get

func (b BaseJS) Get() error

type Format

type Format struct {
	Bitrate         int64
	ContentLength   int64 `json:"contentLength,string"`
	Height          int
	Itag            int
	MimeType        string
	SignatureCipher string
	URL             string
}

func (Format) Write

func (f Format) Write(w io.Writer) error

type Video

type Video struct {
	StreamingData struct {
		AdaptiveFormats []Format
	}
	Microformat struct {
		PlayerMicroformatRenderer struct {
			AvailableCountries []string
			PublishDate        string
		}
	}
	VideoDetails struct {
		Author           string
		ShortDescription string
		Title            string
		ViewCount        int `json:"viewCount,string"`
	}
}

func NewVideo

func NewVideo(id string) (Video, error)

NewVideo fetches video metadata

func (Video) Author

func (v Video) Author() string

func (Video) Countries

func (v Video) Countries() []string

func (Video) Description

func (v Video) Description() string

func (Video) Formats

func (v Video) Formats() []Format

func (Video) NewFormat

func (v Video) NewFormat(itag int) (Format, error)

func (Video) PublishDate

func (v Video) PublishDate() string

func (Video) Title

func (v Video) Title() string

func (Video) ViewCount

func (v Video) ViewCount() int

Jump to

Keyboard shortcuts

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