Documentation
¶
Index ¶
Constants ¶
View Source
const ( // UPLOAD DATE UploadDateLastHour = 1 UploadDateToday = 2 UploadDateThisWeek = 3 UploadDateThisMonth = 4 UploadDateThisYear = 5 // TYPE TypeVideo = 1 TypeChannel = 2 TypePlaylist = 3 TypeMovie = 4 // DURATION DurationUnderFourMinutes = 1 DurationOverTwentyMinutes = 2 DurationFourToTwentyMinutes = 3 // SORT BY SortByRelevance = 0 SortByRating = 1 SortByUploadDate = 2 SortByViewCount = 3 )
Variables ¶
View Source
var ( Android = Client{Name: "ANDROID", Version: "16.43.34"} Embed = Client{Name: "ANDROID", Screen: "EMBED", Version: "16.43.34"} Mweb = Client{Name: "MWEB", Version: "2.20211109.01.00"} )
View Source
var Key = Auth{"X-Goog-Api-Key", "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"}
View Source
var Pictures = PictureSlice{
{120, 90, 68, "default", jpg},
{120, 90, 90, "1", jpg},
{120, 90, 90, "2", jpg},
{120, 90, 90, "3", jpg},
{120, 90, 68, "default", webP},
{120, 90, 90, "1", webP},
{120, 90, 90, "2", webP},
{120, 90, 90, "3", webP},
{320, 180, 180, "mqdefault", jpg},
{320, 180, 320, "mq1", jpg},
{320, 180, 320, "mq2", jpg},
{320, 180, 320, "mq3", jpg},
{320, 180, 180, "mqdefault", webP},
{320, 180, 320, "mq1", webP},
{320, 180, 320, "mq2", webP},
{320, 180, 320, "mq3", webP},
{480, 360, 270, "0", jpg},
{480, 360, 270, "hqdefault", jpg},
{480, 360, 360, "hq1", jpg},
{480, 360, 360, "hq2", jpg},
{480, 360, 360, "hq3", jpg},
{480, 360, 270, "0", webP},
{480, 360, 270, "hqdefault", webP},
{480, 360, 360, "hq1", webP},
{480, 360, 360, "hq2", webP},
{480, 360, 360, "hq3", webP},
{640, 480, 360, "sddefault", jpg},
{640, 480, 480, "sd1", jpg},
{640, 480, 480, "sd2", jpg},
{640, 480, 480, "sd3", jpg},
{640, 480, 360, "sddefault", webP},
{640, 480, 480, "sd1", webP},
{640, 480, 480, "sd2", webP},
{640, 480, 480, "sd3", webP},
{1280, 720, 720, "hq720", jpg},
{1280, 720, 720, "maxres1", jpg},
{1280, 720, 720, "maxres2", jpg},
{1280, 720, 720, "maxres3", jpg},
{1280, 720, 720, "maxresdefault", jpg},
{1280, 720, 720, "hq720", webP},
{1280, 720, 720, "maxres1", webP},
{1280, 720, 720, "maxres2", webP},
{1280, 720, 720, "maxres3", webP},
{1280, 720, 720, "maxresdefault", webP},
}
View Source
var Verbose = mech.Verbose
Functions ¶
Types ¶
type Filter ¶ added in v1.37.1
type Filter struct {
UploadDate int `json:"1,omitempty"`
Type int `json:"2,omitempty"`
Duration int `json:"3,omitempty"`
HD bool `json:"4,omitempty"`
Subtitles bool `json:"5,omitempty"`
CreativeCommons bool `json:"6,omitempty"`
ThreeD bool `json:"7,omitempty"`
Live bool `json:"8,omitempty"`
Purchased bool `json:"9,omitempty"`
FourK bool `json:"14,omitempty"`
ThreeSixty bool `json:"15,omitempty"`
Location bool `json:"23,omitempty"`
HDR bool `json:"25,omitempty"`
VR180 bool `json:"26,omitempty"`
}
type Format ¶
type FormatSlice ¶ added in v1.17.8
type FormatSlice []Format
func (FormatSlice) Filter ¶ added in v1.17.8
func (f FormatSlice) Filter(keep func(Format) bool) FormatSlice
func (FormatSlice) Sort ¶ added in v1.17.8
func (f FormatSlice) Sort(less ...func(a, b Format) bool)
type Item ¶ added in v1.24.9
type Item struct {
CompactVideoRenderer *struct {
LengthText text
Title text
VideoID string
}
}
type PictureSlice ¶ added in v1.21.9
type PictureSlice []Picture
func (PictureSlice) Filter ¶ added in v1.21.9
func (p PictureSlice) Filter(keep func(Picture) bool) PictureSlice
func (PictureSlice) Sort ¶ added in v1.21.9
func (p PictureSlice) Sort(less ...func(a, b Picture) bool)
type Player ¶ added in v1.13.0
type Player struct {
Microformat struct {
PlayerMicroformatRenderer struct {
AvailableCountries []string
PublishDate string
}
}
PlayabilityStatus struct {
Reason string
Status string
}
StreamingData struct {
AdaptiveFormats FormatSlice
// just including this so I can bail if video is Dash Manifest
DashManifestURL string
}
VideoDetails struct {
Author string
ShortDescription string
Title string
ViewCount float64 `json:"viewCount,string"`
}
}
func (Player) Description ¶ added in v1.13.0
Click to show internal directories.
Click to hide internal directories.