gotube

package module
v0.0.0-...-6f048b0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2016 License: MIT Imports: 7 Imported by: 0

README

deprecated, you can use idm/eagleget to easily download youtube video

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FORMAT_LABEL = map[string]string{"5": "FLV 240p", "18": "MP4 360p", "22": "MP4 720p", "34": "FLV 360p", "35": "FLV 480p", "37": "MP4 1080p", "38": "MP4 2160p", "43": "WebM 360p", "44": "WebM 480p", "45": "WebM 720p", "46": "WebM 1080p", "135": "MP4 480p - no audio", "137": "MP4 1080p - no audio", "138": "MP4 2160p - no audio", "139": "M4A 48kbps - audio", "140": "M4A 128kbps - audio", "141": "M4A 256kbps - audio", "264": "MP4 1440p - no audio", "266": "MP4 2160p - no audio", "298": "MP4 720p60 - no audio", "299": "MP4 1080p60 - no audio"}

	FORMAT_TYPE  = map[string]string{"5": "flv", "18": "mp4", "22": "mp4", "34": "flv", "35": "flv", "37": "mp4", "38": "mp4", "43": "webm", "44": "webm", "45": "webm", "46": "webm", "135": "mp4", "137": "mp4", "138": "mp4", "139": "m4a", "140": "m4a", "141": "m4a", "264": "mp4", "266": "mp4", "298": "mp4", "299": "mp4"}
	FORMAT_ORDER = []string{"5", "18", "34", "43", "35", "135", "44", "22", "298", "45", "37", "299", "46", "264", "38", "266", "139", "140", "141"}
)

Thanks to https://github.com/gantt/downloadyoutube

View Source
var (
	ErrorNoMatch = errors.New("regexp no match")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
}

func NewClient

func NewClient() *Client

func (*Client) GetInfo

func (c *Client) GetInfo(url string) (*VideoInfo, error)

get info for common format

func (*Client) GetRawInfo

func (c *Client) GetRawInfo(url string) (*VideoRawInfo, error)

get video's raw info

type DownloadInfo

type DownloadInfo struct {
	FileExtension string
	Url           string
	Type          string
	// contains filtered or unexported fields
}

type KV

type KV map[string]string

func (KV) Get

func (kv KV) Get(k string) string

type VideoInfo

type VideoInfo struct {
	Title                 string
	AvailableDownloadInfo []*DownloadInfo
}

type VideoRawInfo

type VideoRawInfo struct {
	Title          string
	Adaptive_fmts  []KV
	Fmt_stream_map []KV
}

func GenerateVideoInfo

func GenerateVideoInfo(b []byte) (*VideoRawInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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