tubemeta

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 11 Imported by: 1

README

TubeMeta

Fetch Youtube metadata without Youtube Data API v3.

License

This project is under the MIT License

Documentation

Index

Constants

View Source
const (
	YOUTUBE_URL        = "https://www.youtube.com/channel/"
	YOUTUBE_CUSTOM_URL = "https://www.youtube.com/c/"
	YOUTUBE_USER_URL   = "https://www.youtube.com/"
)

Variables

View Source
var (
	ErrInvalidUrl     = errors.New("invalid url")
	ErrInvalidVideoId = errors.New("invalid video id")
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Id             string   `json:"id"`
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	Avatar         string   `json:"avatar"`
	Banner         string   `json:"banner"`
	Url            string   `json:"url"`
	CustomUrl      string   `json:"custom_url"`
	Subscribers    string   `json:"subscribers"`
	Views          string   `json:"views"`
	CreatedAt      string   `json:"created_at"`
	Verified       bool     `json:"verified"`
	Live           bool     `json:"live"`
	Videos         string   `json:"videos"`
	Socials        []string `json:"socials"`
	OngoingStreams []string `json:"ongoing_streams"`
	Streams        []string `json:"streams"`
}

func GetChannel

func GetChannel(channelId string) (*Channel, error)

GetChannel retrieves channel information from a given URL or channel ID. It returns a Channel struct containing the channel details and an error if any.

type Video added in v0.0.3

type Video struct {
	Id                 string
	Title              string
	Description        string
	ViewCount          int
	LikeCount          int
	LiveNow            bool
	LiveContent        bool
	ScheduledStartTime time.Time
	UploadDate         time.Time
	Thumbnails         []string
	URL                string
	Tags               []string
	Duration           string
	ChannelId          string
	Genre              string
}

Video struct contains the details of a YouTube video.

func GetVideo added in v0.0.3

func GetVideo(urlOrId string) (video Video, err error)

GetVideo retrieves video information from a given URL or video ID. It returns a Video struct containing the video details and an error if any.

Jump to

Keyboard shortcuts

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