gokick

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 7 Imported by: 0

README

go-kick

Go Report Card PkgGoDev

go-kick will be api wrapper for kick.com once the public API is released. Currently it only wraps few endpoints on the private api.

Basic example:

package main

import (
	"fmt"
	"log"

	gokick "github.com/hehexdddddddd/go-kick"
)

func main() {
	kick := gokick.New()

	channel, err := kick.Channels.ByName("xqc")
	if err != nil {
		log.Println(err)
		return
	}

	fmt.Print(channel.User.Username)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID          int      `json:"id"`
	CategoryID  int      `json:"category_id"`
	Name        string   `json:"name"`
	Slug        string   `json:"slug"`
	Tags        []string `json:"tags"`
	Description any      `json:"description"`
	DeletedAt   any      `json:"deleted_at"`
	Viewers     int      `json:"viewers"`
	Banner      struct {
		Srcset string `json:"srcset"`
		Src    string `json:"src"`
	} `json:"banner"`
	Category struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Slug string `json:"slug"`
		Icon string `json:"icon"`
	} `json:"category"`
}

type Channel

type Channel struct {
	ID                  int    `json:"id"`
	UserID              int    `json:"user_id"`
	Slug                string `json:"slug"`
	IsBanned            bool   `json:"is_banned"`
	PlaybackURL         string `json:"playback_url"`
	VodEnabled          bool   `json:"vod_enabled"`
	SubscriptionEnabled bool   `json:"subscription_enabled"`
	FollowersCount      int    `json:"followers_count"`
	SubscriberBadges    []struct {
		ID         int `json:"id"`
		ChannelID  int `json:"channel_id"`
		Months     int `json:"months"`
		BadgeImage struct {
			Srcset string `json:"srcset"`
			Src    string `json:"src"`
		} `json:"badge_image"`
	} `json:"subscriber_badges"`
	BannerImage struct {
		URL string `json:"url"`
	} `json:"banner_image"`
	Livestream         any   `json:"livestream"`
	Role               any   `json:"role"`
	Muted              bool  `json:"muted"`
	FollowerBadges     []any `json:"follower_badges"`
	OfflineBannerImage any   `json:"offline_banner_image"`
	Verified           bool  `json:"verified"`
	RecentCategories   []struct {
		ID          int      `json:"id"`
		CategoryID  int      `json:"category_id"`
		Name        string   `json:"name"`
		Slug        string   `json:"slug"`
		Tags        []string `json:"tags"`
		Description any      `json:"description"`
		DeletedAt   any      `json:"deleted_at"`
		Viewers     int      `json:"viewers"`
		Banner      struct {
			Responsive string `json:"responsive"`
			URL        string `json:"url"`
		} `json:"banner"`
		Category struct {
			ID   int    `json:"id"`
			Name string `json:"name"`
			Slug string `json:"slug"`
			Icon string `json:"icon"`
		} `json:"category"`
	} `json:"recent_categories"`
	CanHost bool `json:"can_host"`
	User    struct {
		ID              int       `json:"id"`
		Username        string    `json:"username"`
		AgreedToTerms   bool      `json:"agreed_to_terms"`
		EmailVerifiedAt time.Time `json:"email_verified_at"`
		Bio             string    `json:"bio"`
		Country         string    `json:"country"`
		State           string    `json:"state"`
		City            string    `json:"city"`
		Instagram       string    `json:"instagram"`
		Twitter         string    `json:"twitter"`
		Youtube         string    `json:"youtube"`
		Discord         string    `json:"discord"`
		Tiktok          string    `json:"tiktok"`
		Facebook        string    `json:"facebook"`
		ProfilePic      string    `json:"profile_pic"`
	} `json:"user"`
	Chatroom struct {
		ID                   int       `json:"id"`
		ChatableType         string    `json:"chatable_type"`
		ChannelID            int       `json:"channel_id"`
		CreatedAt            time.Time `json:"created_at"`
		UpdatedAt            time.Time `json:"updated_at"`
		ChatModeOld          string    `json:"chat_mode_old"`
		ChatMode             string    `json:"chat_mode"`
		SlowMode             bool      `json:"slow_mode"`
		ChatableID           int       `json:"chatable_id"`
		FollowersMode        bool      `json:"followers_mode"`
		SubscribersMode      bool      `json:"subscribers_mode"`
		EmotesMode           bool      `json:"emotes_mode"`
		MessageInterval      int       `json:"message_interval"`
		FollowingMinDuration int       `json:"following_min_duration"`
	} `json:"chatroom"`
	// contains filtered or unexported fields
}

type Channels

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

func (*Channels) ByName

func (prof *Channels) ByName(name string) (*Channel, error)

type Kick

type Kick struct {
	Proxy     string
	UserAgent string
	JA3       string

	Channels *Channels
	// contains filtered or unexported fields
}

func New

func New() *Kick

func (*Kick) Search

func (kick *Kick) Search(search string) (*SearchType, error)

func (*Kick) SetHTTPClient

func (kick *Kick) SetHTTPClient(client *cycletls.CycleTLS)

func (*Kick) SetJA3

func (kick *Kick) SetJA3(ja3 string)

SetJA3 sets ja3 for request.

func (*Kick) SetProxy

func (kick *Kick) SetProxy(url string) error

SetProxy sets proxy for connection.

func (*Kick) SetUserAgent

func (kick *Kick) SetUserAgent(useragent string)

SetUserAgent sets useragent for request.

func (*Kick) UnsetJA3

func (kick *Kick) UnsetJA3()

UnsetJA3 unsets ja3 for request.

func (*Kick) UnsetProxy

func (kick *Kick) UnsetProxy()

UnsetProxy unsets proxy for connection.

func (*Kick) UnsetUserAgent

func (kick *Kick) UnsetUserAgent()

UnsetUserAgent unsets useragent for request.

type SearchType

type SearchType struct {
	Channels   []Channel  `json:"channels"`
	Categories []Category `json:"categories"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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