{"id":23988603,"url":"https://github.com/isaackogan/tiktoklive","last_synced_at":"2025-05-15T07:07:24.367Z","repository":{"id":37576073,"uuid":"462948750","full_name":"isaackogan/TikTokLive","owner":"isaackogan","description":"The definitive Python library to receive livestream events (comments, gifts, etc.) in realtime from TikTok LIVE.","archived":false,"fork":false,"pushed_at":"2025-05-10T23:47:36.000Z","size":28961,"stargazers_count":1109,"open_issues_count":3,"forks_count":216,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-11T00:07:29.045Z","etag":null,"topics":["api","chat-reader","connector","printer","python","scraper","stream","tiktok","tiktok-api","tiktok-live","tiktok-printer","tiktok-scraper"],"latest_commit_sha":null,"homepage":"https://tiktoklive.eulerstream.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaackogan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://www.buymeacoffee.com/isaackogan"}},"created_at":"2022-02-24T00:08:43.000Z","updated_at":"2025-05-10T23:47:41.000Z","dependencies_parsed_at":"2023-02-19T09:01:47.188Z","dependency_job_id":"7660538d-414c-47bc-9a81-653f95832b3f","html_url":"https://github.com/isaackogan/TikTokLive","commit_stats":{"total_commits":555,"total_committers":16,"mean_commits":34.6875,"dds":0.04144144144144146,"last_synced_commit":"f6e7d0e485b7c3e1ba05c9677df1a2286ca603dd"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaackogan%2FTikTokLive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaackogan%2FTikTokLive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaackogan%2FTikTokLive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaackogan%2FTikTokLive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaackogan","download_url":"https://codeload.github.com/isaackogan/TikTokLive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","chat-reader","connector","printer","python","scraper","stream","tiktok","tiktok-api","tiktok-live","tiktok-printer","tiktok-scraper"],"created_at":"2025-01-07T16:14:01.919Z","updated_at":"2025-05-15T07:07:19.348Z","avatar_url":"https://github.com/isaackogan.png","language":"Python","funding_links":["https://www.buymeacoffee.com/isaackogan"],"categories":[],"sub_categories":[],"readme":"TikTokLive API\n==================\nThis is an unofficial API wrapper for TikTok LIVE written in Python. With this API you can connect to any TikTok livestream and fetch all data available to users in a stream using just a creator's `@unique_id`.\n\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\u0026style=flat-square)](https://www.linkedin.com/in/isaackogan/)\n[![LinkedIn](https://www.eulerstream.com/api/pips/patrons?v=002)](https://www.eulerstream.com/)\n![Connections](https://tiktok.eulerstream.com/analytics/pips/1)\n![Downloads](https://pepy.tech/badge/tiktoklive)\n![Stars](https://img.shields.io/github/stars/isaackogan/TikTokLive?style=flat\u0026color=0274b5)\n![Forks](https://img.shields.io/github/forks/isaackogan/TikTokLive?style=flat\u0026color=0274b5)\n![Issues](https://img.shields.io/github/issues/isaackogan/TikTokLive)\n\n\u003c!-- [![HitCount](https://hits.dwyl.com/isaackogan/TikTokLive.svg?style=flat)](http://hits.dwyl.com/isaackogan/TikTokLive) --\u003e\n\n\u003c!--\n\nCOMING SOON:\n\n## TikTok LIVE Interactive Bots\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\u003cbr/\u003e\u003cimg width=\"180px\" style=\"border-radius: 10px\" src=\"https://raw.githubusercontent.com/isaackogan/TikTokLive/master/.github/BotsLogo.png\"\u003e\u003cbr/\u003e\u003cbr/\u003e\u003c/td\u003e\n    \u003ctd\u003e\n        \u003ca href=\"https://www.github.com/isaackogan/TikTokLive.py\"\u003e\n          Build interactive chatbots to increase retention \u0026 elevate user experience with the open source TikTokLive bot famework and a  \u003cstrong\u003eEuler Stream\u003c/strong\u003e API key.\n        \u003c/a\u003e\n    \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n--\u003e\n\n## Enterprise Solutions\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\u003cbr/\u003e\u003cimg width=\"180px\" style=\"border-radius: 10px\" src=\"https://raw.githubusercontent.com/isaackogan/TikTokLive/master/.github/SquareLogo.png\"\u003e\u003cbr/\u003e\u003cbr/\u003e\u003c/td\u003e\n    \u003ctd\u003e\n        \u003ca href=\"https://www.eulerstream.com\"\u003e\n            \u003cstrong\u003eEuler Stream\u003c/strong\u003e is a paid TikTok LIVE service providing managed TikTok LIVE WebSocket connections, increased access, TikTok LIVE alerts, JWT authentication and more.\n        \u003c/a\u003e\n    \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Author's Choice\n\nThe following are my two favourite enterprise use-cases for the TikTokLive family of libraries. This is \u003cstrong\u003enot\u003c/strong\u003e paid promotion, and I receive nothing for these recommendations:\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\u003cbr/\u003e\u003cimg width=\"180px\" style=\"border-radius: 10px\" src=\"https://tiktory.com/images/meta/favicon.svg\"\u003e\u003cbr/\u003e\u003cbr/\u003e\u003c/td\u003e\n    \u003ctd\u003e\n        \u003ca href=\"https://www.tiktory.com\"\u003e\n            \u003cstrong\u003eTiktory\u003c/strong\u003e provides highly advanced custom overlays, follower alerts, and real-time goal tracking. Seamlessly integrate with OBS and stand out from the crowd!\n        \u003c/a\u003e\n    \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\u003cbr/\u003e\u003cimg width=\"180px\" style=\"border-radius: 10px\" src=\"https://cdn.casterlabs.co/branding/casterlabs/icon.svg\"\u003e\u003cbr/\u003e\u003cbr/\u003e\u003c/td\u003e\n    \u003ctd\u003e\n        \u003ca href=\"https://casterlabs.co/\"\u003e\n            \u003cstrong\u003eCasterlabs\u003c/strong\u003e is a powerful tool that unifies chats from various streaming platforms, providing a combined chat view, customizable alerts, and handy on-screen widgets for streamers!\n        \u003c/a\u003e\n    \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n    - [Parameters](#parameters)\n    - [Methods](#methods)\n    - [Properties](#properties)\n    - [WebDefaults](#webdefaults)\n- [Documentation](https://isaackogan.github.io/TikTokLive/)\n- [Other Languages](#other-languages)\n- [Community](#community)\n- [Examples](https://github.com/isaackogan/TikTokLive/tree/master/examples)\n- [Licensing](#license)\n- [Star History](#star-history)\n- [Contributors](#contributors)\n\n## Community\n\nJoin the [TikTokLive discord](https://discord.gg/e2XwPNTBBr) and visit\nthe [`#py-support`](https://discord.gg/uja6SajDxd)\nchannel for questions, contributions and ideas.\n\n## Getting Started\n\n1. Install the module via pip from the [PyPi](https://pypi.org/project/TikTokLive/) repository\n\n```shell script\npip install TikTokLive\n```\n\n2. Create your first chat connection\n\n```python\nfrom TikTokLive import TikTokLiveClient\nfrom TikTokLive.events import ConnectEvent, CommentEvent\n\n# Create the client\nclient: TikTokLiveClient = TikTokLiveClient(unique_id=\"@isaackogz\")\n\n\n# Listen to an event with a decorator!\n@client.on(ConnectEvent)\nasync def on_connect(event: ConnectEvent):\n    print(f\"Connected to @{event.unique_id} (Room ID: {client.room_id}\")\n\n\n# Or, add it manually via \"client.add_listener()\"\nasync def on_comment(event: CommentEvent) -\u003e None:\n    print(f\"{event.user.nickname} -\u003e {event.comment}\")\n\n\nclient.add_listener(CommentEvent, on_comment)\n\nif __name__ == '__main__':\n    # Run the client and block the main thread\n    # await client.start() to run non-blocking\n    client.run()\n```\n\nFor more quickstart examples, see the [examples folder](https://github.com/isaackogan/TikTokLive/tree/master/examples)\nprovided in the source tree.\n\n## Other Languages\n\nTikTokLive is available in several alternate programming languages:\n\n- **Node.JS:** [https://github.com/zerodytrash/TikTok-Live-Connector](https://github.com/zerodytrash/TikTok-Live-Connector)\n- **Java:** [https://github.com/jwdeveloper/TikTok-Live-Java](https://github.com/jwdeveloper/TikTok-Live-Java)\n- **C#/Unity:** [https://github.com/frankvHoof93/TikTokLiveSharp](https://github.com/frankvHoof93/TikTokLiveSharp)\n- **Go:** [https://github.com/steampoweredtaco/gotiktoklive](https://github.com/steampoweredtaco/gotiktoklive)\n- **Rust:** [https://github.com/jwdeveloper/TikTokLiveRust](https://github.com/jwdeveloper/TikTokLiveRust)\n\n## Parameters\n\n| Param Name | Required | Default | Description                                                                                                                                                                                                               |\n|------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| unique_id  | Yes      | N/A     | The unique username of the broadcaster. You can find this name in the URL of the user. For example, the `unique_id` for [`https://www.tiktok.com/@isaackogz`](https://www.tiktok.com/@isaackogz) would be `isaackogz`.    |\n| web_proxy  | No       | `None`  | TikTokLive supports proxying HTTP requests. This parameter accepts an `httpx.Proxy`. Note that if you do use a proxy you may be subject to reduced connection limits at times of high load.                               |\n| ws_proxy   | No       | `None`  | TikTokLive supports proxying the websocket connection. This parameter accepts an `httpx.Proxy`. Using this proxy will never be subject to reduced connection limits.                                                      |\n| web_kwargs | No       | `{}`    | Under the scenes, the TikTokLive HTTP client uses the [`httpx`](https://github.com/encode/httpx) library. Arguments passed to `web_kwargs` will be forward the the underlying HTTP client.                                |\n| ws_kwargs  | No       | `{}`    | Under the scenes, TikTokLive uses the [`websockets`](https://github.com/python-websockets/websockets) library to connect to TikTok. Arguments passed to `ws_kwargs` will be forwarded to the underlying WebSocket client. |\n\n## Methods\n\nA `TikTokLiveClient` object contains the following methods worth mentioning:\n\n| Method Name  | Notes   | Description                                                                                                                                                                         |\n|--------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| run          | N/A     | Connect to the livestream and block the main thread. This is best for small scripts.                                                                                                |\n| add_listener | N/A     | Adds an *asynchronous* listener function (or, you can decorate a function with `@client.on(Type[Event])`) and takes two parameters, an event name and the payload, an AbstractEvent ||\n| connect      | `async` | Connects to the tiktok live chat while blocking the current future. When the connection ends (e.g. livestream is over), the future is released.                                     |\n| start        | `async` | Connects to the live chat without blocking the main thread. This returns an `asyncio.Task` object with the client loop.                                                             |\n| disconnect   | `async` | Disconnects the client from the websocket gracefully, processing remaining events before ending the client loop.                                                                    |\n\n## Properties\n\nA `TikTokLiveClient` object contains the following important properties:\n\n| Attribute Name | Description                                                                                                                                                 |\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| room_id        | The Room ID of the livestream room the client is currently connected to.                                                                                    |\n| web            | The TikTok HTTP client. This client has a lot of useful routes you should explore!                                                                          |\n| connected      | Whether you are currently connected to the livestream.                                                                                                      |\n| logger         | The internal logger used by TikTokLive. You can use `client.logger.setLevel(...)` method to enable client debug.                                            |\n| room_info      | Room information that is retrieved from TikTok when you use a connection method (e.g. `client.connect`) with the keyword argument `fetch_room_info=True` .  |\n| gift_info      | Extra gift information that is retrieved from TikTok when you use a connection method (e.g. `client.run`) with the keyword argument `fetch_gift_info=True`. |\n\n## WebDefaults\n\nTikTokLive has a series of global defaults used to create the HTTP client which you can customize. For info on how to set these parameters, see\nthe [web_defaults.py](https://github.com/isaackogan/TikTokLive/blob/master/examples/web_defaults.py) example.\n\n| Parameter                   | Type   | Description                                                                                                                                                                   |\n|-----------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| tiktok_sign_api_key         | `str`  | A [Euler Stream](https://www.eulerstream.com/) API key used to increase rate limits.                                                                                          |\n| tiktok_app_url              | `str`  | The TikTok app URL (`https://www.tiktok.com`) used to scrape the room.                                                                                                        |\n| tiktok_sign_url             | `str`  | The [signature server](https://www.eulerstream.com/) used to generate tokens to connect to TikTokLive. By default, this is Euler Stream, but you can swap your own with ease. |\n| tiktok_webcast_url          | `str`  | The TikTok livestream URL (`https://webcast.tiktok.com`) where livestreams can be accessed from.                                                                              |\n| web_client_params           | `dict` | The URL parameters added on to TikTok requests from the HTTP client.                                                                                                          |\n| web_client_headers          | `dict` | The headers added on to TikTok requests from the HTTP client.                                                                                                                 |\n| web_client_cookies          | `dict` | Custom cookies to initialize the http client with.                                                                                                                            |\n| ws_client_params            | `dict` | The URL parameters added to the URI when connecting to TikTok's Webcast WebSocket server.                                                                                     |\n| ws_client_params_append_str | `dict` | Extra string data to append to the TikTokLive WebSocket connection URI.                                                                                                       |\n| ws_client_headers           | `dict` | Extra headers to append to the TikTokLive WebSocket client.                                                                                                                   |\n| ja3_impersonate             | `str`  | The ja3 fingerprint to impersonate. This should match whatever the current version is on the Sign Server, or \"privileged\" methods will fail.                                  |\n\n## Events\n\nEvents can be listened to using a decorator or non-decorator method call. The following examples illustrate how you can listen to an event:\n\n```python\n@client.on(LikeEvent)\nasync def on_like(event: LikeEvent) -\u003e None:\n    ...\n\n\nasync def on_comment(event: CommentEvent) -\u003e None:\n    ...\n\n\nclient.add_listener(CommentEvent, on_comment)\n```\n\nThere are two types of events, [`CustomEvent`](https://github.com/isaackogan/TikTokLive/blob/master/TikTokLive/events/custom_events.py)\nevents and [`ProtoEvent`](https://github.com/isaackogan/TikTokLive/blob/master/TikTokLive/events/proto_events.py) events.\nBoth belong to the TikTokLive `Event` type and can be listened to. The following events are available:\n\n### Custom Events\n\n- `ConnectEvent` - Triggered when the Webcast connection is initiated\n- `DisconnectEvent` - Triggered when the Webcast connection closes (including the livestream ending)\n- `LiveEndEvent` - Triggered when the livestream ends\n- `LivePauseEvent` - Triggered when the livestream is paused\n- `LiveUnpauseEvent` - Triggered when the livestream is unpaused\n- `FollowEvent` - Triggered when a user in the livestream follows the streamer\n- `ShareEvent` - Triggered when a user shares the livestream\n- `WebsocketResponseEvent` - Triggered when any event is received (contains the event)\n- `UnknownEvent` - An instance of `WebsocketResponseEvent` thrown whenever an event does not have an existing definition, useful for debugging\n\n### Proto Events\n\nIf you know what an event does, [make a pull request](https://github.com/isaackogan/TikTokLive/pulls) and add the description.\n\n\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch4\u003eProto Events\u003c/h4\u003e\u003c/summary\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003eGiftEvent\u003c/code\u003e - Triggered when a gift is sent to the streamer\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGoalUpdateEvent\u003c/code\u003e - Triggered when the subscriber goal is updated\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eControlEvent\u003c/code\u003e - Triggered when a stream action occurs (e.g. Livestream start, end)\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLikeEvent\u003c/code\u003e - Triggered when the stream receives a like\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSubscribeEvent\u003c/code\u003e - Triggered when someone subscribes to the TikTok creator\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePollEvent\u003c/code\u003e - Triggered when the creator launches a new poll\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCommentEvent\u003c/code\u003e - Triggered when a comment is sent in the stream\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomEvent\u003c/code\u003e - Messages broadcasted to all users in the room (e.g. \"Welcome to TikTok LIVE!\")\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEmoteChatEvent\u003c/code\u003e - Triggered when a custom emote is sent in the chat\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEnvelopeEvent\u003c/code\u003e - Triggered every time someone sends a treasure chest\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSocialEvent\u003c/code\u003e - Triggered when a user shares the stream or follows the host\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eQuestionNewEvent\u003c/code\u003e - Triggered every time someone asks a new question via the question feature\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLiveIntroEvent\u003c/code\u003e - Triggered when a live intro message appears\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicArmiesEvent\u003c/code\u003e - Triggered when a TikTok battle user receives points\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicBattleEvent\u003c/code\u003e - Triggered when a TikTok battle is started\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eJoinEvent\u003c/code\u003e - Triggered when a user joins the livestream\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicFanTicketMethodEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicMethodEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBarrageEvent\u003c/code\u003e - Triggered when a \"VIP\" viewer (based on their gifting level) joins the live chat room\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCaptionEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eImDeleteEvent\u003c/code\u003e - Triggered when a viewer's messages are deleted\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomUserSeqEvent\u003c/code\u003e - Current viewer count information\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRankUpdateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRankTextEvent\u003c/code\u003e - Triggered when gift count makes a viewer one of the top three\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eHourlyRankEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eUnauthorizedMemberEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eMessageDetectEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eOecLiveShoppingEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomPinEvent\u003c/code\u003e - Triggered when a message is pinned\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSystemEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkLayerEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eKaraokeQueueListEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGroupLiveMemberNotifyEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSubscriptionGuideEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eNoticeboardReviewEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBottomEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCapsuleEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicBattleEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eQuestionSelectedEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eTrayEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAssetEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eWalletLiveRewardsRatioEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkScreenChangeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePartnershipPunishEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftPanelUpdateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAnchorTaskReminderEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkBusinessEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eMarqueeAnnouncementEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftDynamicRestrictionEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCommonPopupEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEcBarrageEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePromoteAdStatusEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eInteractionHubGoalEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEpiEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkmicAnimationEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eKaraokeYouSingReqEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRealTimePerformancePageEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eStreamStatusEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftCollectionUpdateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCommercialCustomEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGuideEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eDonationEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLiveGameIntroEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePartnershipDropsCardChangeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameGuessWidgetsEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eMiddleTouchEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eUserStatsEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eWallpaperReviewEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicAdEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSubTimerStickerEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftGalleryEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftUpdateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eNoticeboardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eUpgradeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBackpackEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAvatarStyleResultEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameSettingChangeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePartnershipDropsUpdateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eQuestionSwitchEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLiveInfoAuditNoticeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCommonToastEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eToastEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eDonationStickerModifyMethodEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePollEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eHighlightFragementReadyEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftPromptEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eForceFetchRecommendationsEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameGuessPinCardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkLayoutEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameOcrPingEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAnchorGrowLevelEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEnvelopePortalEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCohostReserveEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBaLeadGenEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePictionaryEndEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomNotifyEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eFansEventEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eKaraokeQueueEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eFollowCardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eActivityQuizUserIdentityEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLiveJourneyEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCommentsEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eWeeklyRankRewardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkStateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAccessRecallEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAiSummaryEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePerceptionEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomVerifyEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGuideTaskEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eVideoLiveCouponRcmdEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eVideoLiveGoodsRcmdEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eKaraokeSwitchEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePrivilegeAdvanceEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicBattlePunishFinishEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBoostedUsersEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRankToastEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCommentTrayEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAnchorReminderWordEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePaidContentLiveShoppingEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomEventEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomBottomEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eDonationInfoEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameMomentEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eHashtagEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicBattleItemCardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePrivilegeDynamicEffectEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAnchorGetSubQuotaEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eOecLiveHotRoomEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAudienceReserveUserStateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRealtimeLiveCenterMethodEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eWallpaperEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSubPinEventEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkmicBattleTaskEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eStarCommentPushEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEcTaskRefreshCouponListEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eShortTouchEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEffectControlEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eKaraokeRedDotEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eQuestionDeleteEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eInRoomBannerEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eShareGuideEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEventEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eInRoomBannerEventEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePlayTogetherEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSubContractStatusEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eHourlyRankRewardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePictionaryStartEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGuestInviteEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eNoticeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePartnershipDownloadCountEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGreetingEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLiveShowEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSubWaveEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameReqSetGuessEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eSpeakerEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkMicAnchorGuideEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCompetitionEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAvatarReportDeleteEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eEffectPreloadingEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eColdStartEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCountdownForAllEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftBroadcastEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePreviewGameMomentEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameRecommendCreateGuessEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eVideoLiveGoodsOrderEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eStarCommentNotificationEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eInRoomBannerRefreshEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomStickerEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftProgressEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eOecLiveManagerEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eDiggEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAiLiveSummaryEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eAnchorToolModificationEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eMgPunishCenterActionEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePictionaryExitEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eCountdownEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameServerFeatureEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePlaybookEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGiftRecordCapsuleEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eQuickChatListEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ePartnershipCardChangeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eScreenChatEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGameEmoteUpdateEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBoostCardEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eRoomStreamAdaptationEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eLinkmicBattleNoticeEvent\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGoodyBagEvent\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/details\u003e\n\n### Special Events\n\n### `GiftEvent`\n\nTriggered every time a gift arrives. Extra information can be gleamed from the `available_gifts` client attribute.\n\u003e **NOTE:** Users have the capability to send gifts in a streak. This increases the `event.gift.repeat_count` value until the\n\u003e user terminates the streak. During this time new gift events are triggered again and again with an\n\u003e increased `event.gift.repeat_count` value. It should be noted that after the end of a streak, a final gift event is\n\u003e triggered, which signals the end of the streak with `event.repeat_end`:`1`. The following handlers show how you can deal with this in your code.\n\nUsing the low-level direct proto:\n\n```python\n@client.on(GiftEvent)\nasync def on_gift(event: GiftEvent):\n    # If it's type 1 and the streak is over\n    if event.gift.info.type == 1:\n        if event.gift.is_repeating == 1:\n            print(f\"{event.user.unique_id} sent {event.repeat_count}x \\\"{event.gift.name}\\\"\")\n\n    # It's not type 1, which means it can't have a streak \u0026 is automatically over\n    elif event.gift.info.type != 1:\n        print(f\"{event.user.unique_id} sent \\\"{event.gift.name}\\\"\")\n```\n\nUsing the TikTokLive extended proto:\n\n```python\n@client.on(\"gift\")\nasync def on_gift(event: GiftEvent):\n    # Streakable gift \u0026 streak is over\n    if event.gift.streakable and not event.streaking:\n        print(f\"{event.user.unique_id} sent {event.repeat_count}x \\\"{event.gift.name}\\\"\")\n\n    # Non-streakable gift\n    elif not event.gift.streakable:\n        print(f\"{event.user.unique_id} sent \\\"{event.gift.name}\\\"\")\n```\n\n### `SubscribeEvent`\n\nThis event will only fire when a session ID (account login) is passed to the HTTP client *before* connecting to TikTok LIVE.\nYou can set the session ID with [`client.web.set_session_id(...)`](https://github.com/isaackogan/TikTokLive/blob/master/examples/logged_in.py).\n\n## Checking If A User Is Live\n\nIt is considered inefficient to use the connect method to check if a user is live. It is better to use the dedicated `await client.is_live()` method.\n\nThere is a [complete example](https://github.com/isaackogan/TikTokLive/blob/master/examples/check_live.py) of how to do this in the [examples](https://github.com/isaackogan/TikTokLive/tree/master/examples) folder.\n\n## Star History\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=isaackogan/TikTokLive\u0026type=Date\u0026theme=dark\" onerror=\"this.src='https://api.star-history.com/svg?repos=isaackogan/TikTokLive\u0026type=Date'\" /\u003e\n\u003c/p\u003e\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributors\n\n* **Isaac Kogan** - *Creator, Primary Maintainer, and Reverse-Engineering* - [isaackogan](https://github.com/isaackogan)\n* **Zerody** - *Creator of the NodeJS library, introduced me to scraping TikTok LIVE* - [Zerody](https://github.com/zerodytrash/)\n\nSee also the full list of secondary [contributors](https://github.com/isaackogan/TikTokLive/contributors) who have participated in\nthis project.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaackogan%2Ftiktoklive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaackogan%2Ftiktoklive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaackogan%2Ftiktoklive/lists"}