Documentation
¶
Index ¶
- Constants
- Variables
- func VideoID(address string) (string, error)
- type Client
- type Exchange
- type Filter
- func (f Filter) CreativeCommons(val uint64) Filter
- func (f Filter) Duration(val uint64) Filter
- func (f Filter) FourK(val uint64) Filter
- func (f Filter) HD(val uint64) Filter
- func (f Filter) HDR(val uint64) Filter
- func (f Filter) Live(val uint64) Filter
- func (f Filter) Location(val uint64) Filter
- func (f Filter) Purchased(val uint64) Filter
- func (f Filter) Subtitles(val uint64) Filter
- func (f Filter) ThreeD(val uint64) Filter
- func (f Filter) ThreeSixty(val uint64) Filter
- func (f Filter) Type(val uint64) Filter
- func (f Filter) UploadDate(val uint64) Filter
- func (f Filter) VR180(val uint64) Filter
- type Format
- type Image
- type Item
- type OAuth
- type Params
- type PlayabilityStatus
- type Player
- type Search
- type VideoDetails
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: "17.05.35"} Embed = Client{Name: "ANDROID", Screen: "EMBED", Version: "17.05.35"} Mweb = Client{Name: "MWEB", Version: "2.20211109.01.00"} )
View Source
var Images = []Image{ {Width: 120, Height: 90, Base: "default.jpg"}, {Width: 120, Height: 90, Base: "1.jpg"}, {Width: 120, Height: 90, Base: "2.jpg"}, {Width: 120, Height: 90, Base: "3.jpg"}, {Width: 120, Height: 90, Base: "default.webp"}, {Width: 120, Height: 90, Base: "1.webp"}, {Width: 120, Height: 90, Base: "2.webp"}, {Width: 120, Height: 90, Base: "3.webp"}, {Width: 320, Height: 180, Base: "mq1.jpg", Crop: true}, {Width: 320, Height: 180, Base: "mq2.jpg", Crop: true}, {Width: 320, Height: 180, Base: "mq3.jpg", Crop: true}, {Width: 320, Height: 180, Base: "mqdefault.jpg"}, {Width: 320, Height: 180, Base: "mq1.webp", Crop: true}, {Width: 320, Height: 180, Base: "mq2.webp", Crop: true}, {Width: 320, Height: 180, Base: "mq3.webp", Crop: true}, {Width: 320, Height: 180, Base: "mqdefault.webp"}, {Width: 480, Height: 360, Base: "0.jpg"}, {Width: 480, Height: 360, Base: "hqdefault.jpg"}, {Width: 480, Height: 360, Base: "hq1.jpg"}, {Width: 480, Height: 360, Base: "hq2.jpg"}, {Width: 480, Height: 360, Base: "hq3.jpg"}, {Width: 480, Height: 360, Base: "0.webp"}, {Width: 480, Height: 360, Base: "hqdefault.webp"}, {Width: 480, Height: 360, Base: "hq1.webp"}, {Width: 480, Height: 360, Base: "hq2.webp"}, {Width: 480, Height: 360, Base: "hq3.webp"}, {Width: 640, Height: 480, Base: "sddefault.jpg"}, {Width: 640, Height: 480, Base: "sd1.jpg"}, {Width: 640, Height: 480, Base: "sd2.jpg"}, {Width: 640, Height: 480, Base: "sd3.jpg"}, {Width: 640, Height: 480, Base: "sddefault.webp"}, {Width: 640, Height: 480, Base: "sd1.webp"}, {Width: 640, Height: 480, Base: "sd2.webp"}, {Width: 640, Height: 480, Base: "sd3.webp"}, {Width: 1280, Height: 720, Base: "hq720.jpg"}, {Width: 1280, Height: 720, Base: "maxresdefault.jpg"}, {Width: 1280, Height: 720, Base: "maxres1.jpg"}, {Width: 1280, Height: 720, Base: "maxres2.jpg"}, {Width: 1280, Height: 720, Base: "maxres3.jpg"}, {Width: 1280, Height: 720, Base: "hq720.webp"}, {Width: 1280, Height: 720, Base: "maxresdefault.webp"}, {Width: 1280, Height: 720, Base: "maxres1.webp"}, {Width: 1280, Height: 720, Base: "maxres2.webp"}, {Width: 1280, Height: 720, Base: "maxres3.webp"}, }
View Source
var LogLevel format.LogLevel
Functions ¶
Types ¶
type Client ¶ added in v1.16.9
type Client struct { Name string `json:"clientName"` Screen string `json:"clientScreen,omitempty"` Version string `json:"clientVersion"` }
func (Client) PlayerHeader ¶ added in v1.45.1
func (Client) PlayerResponse ¶ added in v1.45.0
type Exchange ¶ added in v1.20.3
func OpenExchange ¶ added in v1.44.5
type Filter ¶ added in v1.37.1
func (Filter) CreativeCommons ¶ added in v1.37.1
func (Filter) ThreeSixty ¶ added in v1.37.1
func (Filter) UploadDate ¶ added in v1.37.1
type Format ¶
type Item ¶ added in v1.24.9
type Item struct { CompactVideoRenderer *struct { LengthText text Title text VideoID string } }
type PlayabilityStatus ¶ added in v1.40.3
type PlayabilityStatus struct { Status string // LOGIN_REQUIRED Reason string // Sign in to confirm your age }
func (PlayabilityStatus) String ¶ added in v1.45.4
func (p PlayabilityStatus) String() string
type Player ¶ added in v1.13.0
type Player struct { Microformat struct { PlayerMicroformatRenderer struct { AvailableCountries []string PublishDate string // 2013-06-11 } } PlayabilityStatus PlayabilityStatus StreamingData struct { AdaptiveFormats []Format // just including this so I can bail if video is Dash Manifest DashManifestURL string Formats []Format } VideoDetails VideoDetails }
type Search ¶ added in v1.11.2
type Search struct { Contents struct { SectionListRenderer struct { Contents []struct { ItemSectionRenderer *struct { Contents []Item } } } } }
type VideoDetails ¶ added in v1.13.6
type VideoDetails struct { VideoID string LengthSeconds int64 `json:"lengthSeconds,string"` ViewCount int64 `json:"viewCount,string"` Author string Title string ShortDescription string }
func (VideoDetails) Duration ¶ added in v1.45.4
func (v VideoDetails) Duration() time.Duration
func (VideoDetails) String ¶ added in v1.45.4
func (v VideoDetails) String() string
Click to show internal directories.
Click to hide internal directories.