Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWSSURL ¶
func BuildWSSURL(cdnHost string, roomID string, timezone string, language string, region string) string
BuildWSSURL constructs the TikTok Live WebSocket URL for a given room. The timezone parameter should be an IANA timezone name (e.g. "Europe/London").
func DecompressIfGzipped ¶ added in v0.1.4
DecompressIfGzipped checks for gzip magic bytes and decompresses if present.
func RunWebSocket ¶
func RunWebSocket(ctx context.Context, wssURL string, cookieHeader string, userAgent string, roomID string, staleTimeout time.Duration, acceptLanguage string, proxy string, eventCh chan<- events.Event) error
RunWebSocket connects to the TikTok Live WSS endpoint and streams events. The userAgent parameter sets the User-Agent header for the WSS handshake. The cookieHeader is the full Cookie header value (e.g. "ttwid=xxx; sessionid=yyy"). Pass acceptLanguage for locale-aware header (e.g. "ro-RO,ro;q=0.9"). Empty = auto-detect. Pass proxy URL for HTTP CONNECT tunneling; empty falls back to env vars.
Types ¶
type DeviceBlockedError ¶
type DeviceBlockedError struct{}
DeviceBlockedError is returned when the WSS handshake responds with Handshake-Msg: DEVICE_BLOCKED, meaning the ttwid was flagged.
func (*DeviceBlockedError) Error ¶
func (e *DeviceBlockedError) Error() string