utils

package
v0.0.0-...-4a4c199 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewDecoderIfEnviable

func CreateNewDecoderIfEnviable(dcaBytes *[]byte, playedBytes int, options *dca.EncodeOptions) (decoder *dca.Decoder, readerIndex int, err error)

func GetRule34UrlImageFromTags

func GetRule34UrlImageFromTags(tags []string, limit int) (urls []string, err error)
func GetVideoIdFromLink(link string) string

func GetYoutubeStreamMemory

func GetYoutubeStreamMemory(args []string, session disgord.Session, channelID disgord.Snowflake) (track *cache.MusicBotTrack, err error)

func LogErrorCommand

func LogErrorCommand()

func PlayDCAAudio

func PlayDCAAudio(guildID disgord.Snowflake, channelID disgord.Snowflake, session disgord.Session) (err error)

Types

type Rule34Posts

type Rule34Posts struct {
	XMLName xml.Name    `xml:"posts"`
	Count   string      `xml:"count,attr"`
	Offset  string      `xml:"offset,attr"`
	Tags    []Rule34Tag `xml:"tag"`
}

type Rule34Tag

type Rule34Tag struct {
	XMLName       xml.Name `xml:"tag"`
	ID            string   `xml:"id,attr"`
	MD5           string   `xml:"md5,attr"`
	FileName      string   `xml:"file_name,attr"`
	FileUrl       string   `xml:"file_url,attr"`
	Height        string   `xml:"height,attr"`
	Width         string   `xml:"width,attr"`
	PreviewHeight string   `xml:"preview_height,attr"`
	PreviewWidth  string   `xml:"preview_width,attr"`
	Rating        string   `xml:"rating,attr"`
	Date          string   `xml:"date,attr"`
	Tags          string   `xml:"tags,attr"`
	Source        string   `xml:"source,attr"`
	Score         string   `xml:"score,attr"`
	Author        string   `xml:"author,attr"`
}

type Video

type Video struct {
	ID string `json:"encrypted_id"`

	Title       string `json:"title"`
	Description string `json:"description"`
	Thumbnail   string `json:"thumbnail"`

	Added       string    `json:"added"`
	TimeCreated time.Time `json:"time_created"`

	Rating   float64 `json:"rating"`
	Likes    uint    `json:"likes"`
	Dislikes uint    `json:"dislikes"`

	Views    string `json:"views"`
	Comments string `json:"comments"`

	Duration      string        `json:"duration"`
	LengthSeconds time.Duration `json:"length_seconds"`

	Author  string `json:"author"`
	UserID  string `json:"user_id"`
	Privacy string `json:"privacy"`

	CategoryID uint `json:"category_id"`

	IsHD bool `json:"is_hd"`
	IsCC bool `json:"is_cc"`

	CCLicense bool `json:"cc_license"`

	Keywords []string `json:"keywords"`
}

func ParseRawVideo

func ParseRawVideo(v *fastjson.Value) Video

type YoutubeSearchQuery

type YoutubeSearchQuery struct {
	Hits   uint    `json:"hits"`
	Videos []Video `json:"video"`
}

func SearchYoutubeVideos

func SearchYoutubeVideos(keywords []string, page string) (query *YoutubeSearchQuery, err error)

Jump to

Keyboard shortcuts

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