connect
Start a future-blocking connection to TikTokLive.
Method of TikTokLiveClient.
Start a future-blocking connection to TikTokLive.
Kwargs are spelled out (not **kwargs) so IDE autocomplete and
mypy can verify call sites. Every option is forwarded to
start.
Signature
Section titled “Signature”async def connect( callback: Optional[Union[Callable[[None], None], Callable[[None], Coroutine[None, None, None]], Coroutine[None, None, None]]] = None, *, process_connect_events: bool = True, compress_ws_events: bool = True, fetch_room_info: bool = False, fetch_gift_info: bool = False, fetch_live_check: bool = True, room_id: Optional[int] = None,) -> TaskParameters
Section titled “Parameters”callback(Optional[Union[Callable[[None], None], Callable[[None], Coroutine[None, None, None]], Coroutine[None, None, None]]], defaultNone) — A callback function to run when connectedprocess_connect_events(bool, defaultTrue) — Whether to process initial events sent on room joincompress_ws_events(bool, defaultTrue) — Whether to compress WebSocket events using gzipfetch_room_info(bool, defaultFalse) — Whether to fetch room info on joinfetch_gift_info(bool, defaultFalse) — Whether to fetch gift info on joinfetch_live_check(bool, defaultTrue) — Whether to check if the user is liveroom_id(Optional[int], defaultNone) — Optional override to skip room scraping
Returns
Section titled “Returns”Task — The task, once it’s finished
Import
Section titled “Import”from TikTokLive import TikTokLiveClient