youtube

package module
v0.0.0-...-c36c7e4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Welcome to go-youtube 👋 *** Work In Progress ***

GitHub code size in bytes GitHub go.mod Go version GitHub closed pull requests GitHub pull requests GitHub issues GitHub contributors

go-youtube is a Go client library for accessing the YouTube API

🚚 Install

go get github.com/tsirysndr/go-youtube

🚀 Usage

Import the package into your project.

import "github.com/tsirysndr/go-youtube"

Construct a new YouTube client, then use the various services on the client to access different parts of the YouTube API. For example:

client := youtube.NewClient("<YOUR TOKEN AUTHORIZATION>", "<YOUR API KEY>")
result, _ := client.Search.Search("doja cat")
r, _ := json.Marshal(result)
fmt.Println(string(r))

Author

👤 Tsiry Sandratraina

Show your support

Give a ⭐️ if this project helped you!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryService

type CategoryService service

type ChannelService

type ChannelService service

type Client

type Client struct {
	Category     *CategoryService
	Channel      *ChannelService
	Comment      *CommentService
	Playlist     *PlaylistService
	PlaylistItem *PlaylistItemService
	Search       *SearchService
	Thumbnail    *ThumbnailService
	Video        *VideoService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(accessToken, apikey string) *Client

type CommentService

type CommentService service

type Item

type Item struct {
	Kind string `json:"kind,omitempty"`
	Etag string `json:"etag,omitempty"`
	ID   *struct {
		Kind      string  `json:"kind,omitempty"`
		ChannelID *string `json:"channelId,omitempty"`
		VideoID   *string `json:"videoId,omitempty"`
	} `json:"id,omitempty"`
	Snippet Snippet `json:"snippet,omitempty"`
}

type KeyParam

type KeyParam struct {
	// contains filtered or unexported fields
}

type PlaylistItemService

type PlaylistItemService service

type PlaylistService

type PlaylistService service

type SearchParams

type SearchParams struct {
	Part       string `url:"part,omitempty"`
	MaxResults int    `url:"maxResults,omitempty"`
	Q          string `url:"q,omitempty"`
}

type SearchResult

type SearchResult struct {
	Kind          string `json:"kind,omitempty"`
	Etag          string `json:"etag,omitempty"`
	NextPageToken string `json:"nextPageToken,omitempty"`
	RegionCode    string `json:"regionCode,omitempty"`
	PageInfo      *struct {
		TotalResults   int `json:"totalResults,omitempty"`
		ResultsPerPage int `json:"resultsPerPage,omitempty"`
	} `json:"pageInfo,omitempty"`
	Items []Item `json:"items,omitempty"`
}

type SearchService

type SearchService service

func (*SearchService) Search

func (s *SearchService) Search(q string) (*SearchResult, error)

type Snippet

type Snippet struct {
	PublishedAt string     `json:"publishedAt,omitempty"`
	ChannelID   string     `json:"channelId,omitempty"`
	Title       string     `json:"title,omitempty"`
	Description string     `json:"description,omitempty"`
	Thumbnails  Thumbnails `json:"thumbnails,omitempty"`
}

type ThumbnailService

type ThumbnailService service

type Thumbnails

type Thumbnails struct {
	Default *struct {
		URL    string `json:"url,omitempty"`
		Width  int    `json:"width,omitempty"`
		Height int    `json:"height,omitempty"`
	} `json:"default,omitempty"`
	Medium *struct {
		URL    string `json:"url,omitempty"`
		Width  int    `json:"width,omitempty"`
		Height int    `json:"height,omitempty"`
	} `json:"medium,omitempty"`
	High *struct {
		URL    string `json:"url,omitempty"`
		Width  int    `json:"width,omitempty"`
		Height int    `json:"height,omitempty"`
	} `json:"high,omitempty"`
}

type VideoService

type VideoService service

Directories

Path Synopsis
example
search command

Jump to

Keyboard shortcuts

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