Versions in this module Expand all Collapse all v1 v1.8.4 Oct 2, 2024 Changes in this version + var ErrNoResponse = errors.New("no response") + var ErrQualityNotAvailable = errors.New("requested quality is not available") + var ErrRateLimit = errors.New("API rate limited") + var ErrUnknownLatency = errors.New("unknown latency") + var ErrUnknownQuality = errors.New("unknown quality") + var ErrWebSocketEmptyPlaylist = errors.New("server did not return a valid playlist") + var ErrWebSocketLoginRequired = errors.New("login required") + var ErrWebSocketMultipleConnection = errors.New("multiple connection error") + var ErrWebSocketPaidProgram = errors.New("paid program") + var ErrWebSocketServerDisconnection = errors.New("server disconnected") + var ErrWebSocketStreamEnded = errors.New("stream ended") + type Channel struct + Adult json.Number + Description string + Fc2ID json.Number + Images []interface{} + Result json.Number + Title string + URL string + UserID json.Number + type ChannelData struct + Adult json.Number + Amount json.Number + Category string + CategoryName string + ChannelID string + CommentLimit string + ControlTag string + Count json.Number + FC2Channel Channel + Fee json.Number + GiftLimit json.Number + GiftList []ChannelDataGiftList + Image string + Info string + Interval json.Number + IsApp json.Number + IsLimited json.Number + IsLinkShare json.Number + IsOfficial json.Number + IsPremium json.Number + IsPremiumPublisher json.Number + IsPublish int64 + IsREST json.Number + IsVideo json.Number + LoginOnly json.Number + PublishMethod string + Start json.Number + Tfollow json.Number + TicketOnly json.Number + TicketPrice json.Number + Ticketid json.Number + Title string + Tname string + Twoshot json.Number + UserID string + Version string + VideoHorizontalView interface{} + VideoMapping interface{} + VideoStereo3D interface{} + type ChannelDataGiftList struct + ID json.Number + Name string + Type json.Number + URL []string + type Client struct + func NewClient(client *http.Client) *Client + func (c *Client) FindRestrictedStream(ctx context.Context) (string, error) + func (c *Client) FindUnrestrictedStream(ctx context.Context) (string, error) + func (c *Client) GetMeta(ctx context.Context, channelID string) (GetMetaData, error) + func (c *Client) GetWebSocketURL(ctx context.Context, meta GetMetaData) (wsURL string, controlToken ControlToken, err error) + func (c *Client) Login(ctx context.Context) error + func (c *Client) LoginLoop(ctx context.Context, duration time.Duration) + type Comment struct + Anonymous json.Number + Color string + Comment string + EncryptedUserID string + Hash string + History json.Number + Lang string + OrzToken string + Size string + Timestamp json.Number + UserName string + type CommentArguments struct + Comments []Comment + type ControlDisconnectionArguments struct + Code int + type ControlToken struct + AdultAccess json.Number + AgentID json.Number + AppInstallKey string + ChannelListChannelID string + ChannelListChannelVersion string + ClientApp string + ClientType string + ClientVersion string + Commentable json.Number + CountryCode string + Exp json.Number + ID string + IP string + Ipv6 string + Language string + Mode string + OrzToken string + PayMode json.Number + Premium json.Number + ServiceID json.Number + UserID string + UserName string + type GetChannelListChannel struct + Amount json.Number + App json.Number + Bid string + Category json.Number + CommentL json.Number + CommentScore json.Number + Count json.Number + DenyCountryFlg string + Fc2ID json.Number + ID string + Image string + Interval json.Number + Lang string + Login json.Number + Name string + Official json.Number + Panorama json.Number + Pay json.Number + Price json.Number + Sex string + Start string + StartTime json.Number + Tid json.Number + Title string + Total json.Number + Type json.Number + Video json.Number + type GetChannelListResponse struct + Channel []GetChannelListChannel + IsAdult int64 + Link string + Time int64 + type GetControlServerResponse struct + ControlToken string + Orz string + OrzRaw string + Status json.Number + URL string + type GetMetaData struct + ChannelData ChannelData + ProfileData ProfileData + UserData UserData + type GetMetaResponse struct + Data GetMetaData + Status json.Number + type HLSInformation struct + Playlists []Playlist + PlaylistsHighLatency []Playlist + PlaylistsMiddleLatency []Playlist + Status json.Number + type Latency int + const LatencyHigh + const LatencyLow + const LatencyMid + const LatencyUnknown + func LatencyFromMode(mode int) Latency + func LatencyParseString(value string) Latency + func (l *Latency) UnmarshalText(text []byte) error + func (l Latency) String() string + type Playlist struct + Mode int + Status json.Number + URL string + func ExtractAndMergePlaylists(hlsInfo HLSInformation) []Playlist + func GetPlaylistOrBest(sortedPlaylists []Playlist, expectMode int) (Playlist, error) + func SortPlaylists(playlists []Playlist) []Playlist + type ProfileData struct + Age string + Fc2ID string + Icon string + Image string + Info string + Name string + Sex string + UserID string + type Quality int + const Quality150KBps + const Quality1_2MBps + const Quality2MBps + const Quality3MBps + const Quality400KBps + const QualitySound + const QualityUnknown + func QualityFromMode(mode int) Quality + func QualityParseString(value string) Quality + func (q *Quality) UnmarshalText(text []byte) error + func (q Quality) String() string + type UserData struct + AdultAccess interface{} + Fc2ID json.Number + GiftList interface{} + Icon string + IsLogin json.Number + IsPremiumUser interface{} + Name string + Point interface{} + Recauth interface{} + Stamina interface{} + UserID json.Number + type WSResponse struct + Arguments json.RawMessage + ID int64 + Name string + func (r WSResponse) String() string + type WebSocket struct + func NewWebSocket(client *http.Client, url string, healthCheckInterval time.Duration) *WebSocket + func (w *WebSocket) Dial(ctx context.Context) (*websocket.Conn, error) + func (w *WebSocket) FetchPlaylist(ctx context.Context, conn *websocket.Conn, msgChan chan *WSResponse, ...) (playlist Playlist, availables []Playlist, err error) + func (w *WebSocket) GetHLSInformation(ctx context.Context, conn *websocket.Conn, msgChan <-chan *WSResponse) (HLSInformation, error) + func (w *WebSocket) HeartbeatLoop(ctx context.Context, conn *websocket.Conn, msgChan <-chan *WSResponse) error + func (w *WebSocket) Listen(ctx context.Context, conn *websocket.Conn, msgChan chan<- *WSResponse, ...) error v1.8.4-rc.2 Sep 28, 2024 v1.8.4-rc.1 Sep 25, 2024