Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientName = []string{
android,
android_embedded_player,
web,
}
View Source
var YtImgs = []YtImg{
{Width: 120, Height: 90, Name: "default.jpg"},
{Width: 120, Height: 90, Name: "1.jpg"},
{Width: 120, Height: 90, Name: "2.jpg"},
{Width: 120, Height: 90, Name: "3.jpg"},
{Width: 120, Height: 90, Name: "default.webp"},
{Width: 120, Height: 90, Name: "1.webp"},
{Width: 120, Height: 90, Name: "2.webp"},
{Width: 120, Height: 90, Name: "3.webp"},
{Width: 320, Height: 180, Name: "mq1.jpg"},
{Width: 320, Height: 180, Name: "mq2.jpg"},
{Width: 320, Height: 180, Name: "mq3.jpg"},
{Width: 320, Height: 180, Name: "mqdefault.jpg"},
{Width: 320, Height: 180, Name: "mq1.webp"},
{Width: 320, Height: 180, Name: "mq2.webp"},
{Width: 320, Height: 180, Name: "mq3.webp"},
{Width: 320, Height: 180, Name: "mqdefault.webp"},
{Width: 480, Height: 360, Name: "0.jpg"},
{Width: 480, Height: 360, Name: "hqdefault.jpg"},
{Width: 480, Height: 360, Name: "hq1.jpg"},
{Width: 480, Height: 360, Name: "hq2.jpg"},
{Width: 480, Height: 360, Name: "hq3.jpg"},
{Width: 480, Height: 360, Name: "0.webp"},
{Width: 480, Height: 360, Name: "hqdefault.webp"},
{Width: 480, Height: 360, Name: "hq1.webp"},
{Width: 480, Height: 360, Name: "hq2.webp"},
{Width: 480, Height: 360, Name: "hq3.webp"},
{Width: 640, Height: 480, Name: "sddefault.jpg"},
{Width: 640, Height: 480, Name: "sd1.jpg"},
{Width: 640, Height: 480, Name: "sd2.jpg"},
{Width: 640, Height: 480, Name: "sd3.jpg"},
{Width: 640, Height: 480, Name: "sddefault.webp"},
{Width: 640, Height: 480, Name: "sd1.webp"},
{Width: 640, Height: 480, Name: "sd2.webp"},
{Width: 640, Height: 480, Name: "sd3.webp"},
{Width: 1280, Height: 720, Name: "hq720.jpg"},
{Width: 1280, Height: 720, Name: "maxresdefault.jpg"},
{Width: 1280, Height: 720, Name: "maxres1.jpg"},
{Width: 1280, Height: 720, Name: "maxres2.jpg"},
{Width: 1280, Height: 720, Name: "maxres3.jpg"},
{Width: 1280, Height: 720, Name: "hq720.webp"},
{Width: 1280, Height: 720, Name: "maxresdefault.webp"},
{Width: 1280, Height: 720, Name: "maxres1.webp"},
{Width: 1280, Height: 720, Name: "maxres2.webp"},
{Width: 1280, Height: 720, Name: "maxres3.webp"},
}
Functions ¶
This section is empty.
Types ¶
type AdaptiveFormat ¶ added in v1.4.6
type AdaptiveFormat struct { AudioQuality string Bitrate int ContentLength int64 `json:",string"` Itag int MimeType string QualityLabel string Url string }
func (AdaptiveFormat) CompareBitrate ¶ added in v1.4.6
func (a AdaptiveFormat) CompareBitrate(b AdaptiveFormat) int
func (*AdaptiveFormat) Ext ¶ added in v1.4.6
func (a *AdaptiveFormat) Ext() (string, error)
func (*AdaptiveFormat) Ranges ¶ added in v1.4.6
func (a *AdaptiveFormat) Ranges() []string
we need the length for progress meter, so cannot use a channel
func (*AdaptiveFormat) String ¶ added in v1.4.6
func (a *AdaptiveFormat) String() string
type AuthToken ¶ added in v1.4.6
type Date ¶ added in v1.4.8
func (*Date) UnmarshalText ¶ added in v1.4.8
type DeviceCode ¶
type DeviceCode struct { DeviceCode string `json:"device_code"` UserCode string `json:"user_code"` VerificationUrl string `json:"verification_url"` }
func (*DeviceCode) Marshal ¶ added in v1.4.8
func (d *DeviceCode) Marshal() ([]byte, error)
func (*DeviceCode) New ¶ added in v1.4.6
func (d *DeviceCode) New() error
func (*DeviceCode) String ¶
func (d *DeviceCode) String() string
func (*DeviceCode) Token ¶
func (d *DeviceCode) Token() (*AuthToken, error)
func (*DeviceCode) Unmarshal ¶ added in v1.4.8
func (d *DeviceCode) Unmarshal(text []byte) error
type InnerTube ¶ added in v1.4.8
type InnerTube struct { ContentCheckOk bool `json:"contentCheckOk,omitempty"` Context struct { Client struct { AndroidSdkVersion int `json:"androidSdkVersion"` ClientName string `json:"clientName"` ClientVersion string `json:"clientVersion"` OsVersion string `json:"osVersion"` } `json:"client"` } `json:"context"` RacyCheckOk bool `json:"racyCheckOk,omitempty"` VideoId string `json:"videoId"` }
need `osVersion` this to get the correct: This video requires payment to watch instead of the invalid: This video can only be played on newer versions of Android or other supported devices.
type Player ¶
type Player struct { Microformat struct { PlayerMicroformatRenderer struct { PublishDate Date } } PlayabilityStatus struct { Status string Reason string } StreamingData struct { AdaptiveFormats []AdaptiveFormat } VideoDetails struct { Author string LengthSeconds int64 `json:",string"` ShortDescription string Title string VideoId string ViewCount int64 `json:",string"` } }
Click to show internal directories.
Click to hide internal directories.