Basic Feature¶
Client¶
- class Client(loop: AbstractEventLoop | None = None, authorization_key: str | None = None, session_key: str | None = None)¶
Represents a client to connect Chzzk (Naver Live Streaming).
- async close()¶
Closes the connection to chzzk.
- async live_detail(channel_id: str) LiveDetail | None ¶
Get a live detail info of broadcaster.
- Parameters:
channel_id (str) – The channel ID of broadcaster
- Returns:
Return LiveDetail info. Sometimes the broadcaster is not broadcasting, returns None.
- Return type:
Optional[LiveDetail]
- async live_status(channel_id: str) LiveStatus | None ¶
Get a live status info of broadcaster.
- Parameters:
channel_id (str) – The channel ID of broadcaster
- Returns:
Return LiveStatus info. Sometimes the broadcaster is not broadcasting, returns None.
- Return type:
Optional[LiveStatus]
- login(authorization_key: str, session_key: str)¶
Login at Chzzk. Used for features that require a login. (ex. user method)
- manage(channel_id: str | None = None) ManageClient ¶
Get a client provided broadcast management functionality.
- Parameters:
channel_id (Optional[str]) – A channel id to manage broadcasts. The default value is the last channel id used. If initally use the manage method and don’t have a channel_id argument, it will raise a
TypeError
exception.- Returns:
Return a client provided broadcast management functionality.
- Return type:
Enumerations¶
Channel¶
- class PartialChannel¶
-
- personal_data: ChannelPersonalData | None¶
Search¶
- class SearchResult¶
Bases:
ChzzkModel
- channel: Channel | PartialChannel | None¶
User¶
- class PartialUser¶
- async add_restrict()¶
Add this user to restrict activity.
- async add_role(role: UserRole)¶
Add a broadcast permission to this user.
- Parameters:
role (UserRole) – A enumeration class containing broadcast role. It can only set the role to
UserRole.chat_manager
,UserRole.settlement_manager
, orUserRole.channel_manager
. Giving any other role will cause aTypeError
exception.
- async chat_activity_count() ChatActivityCount ¶
Get chat activity count of this user.
- Returns:
Returns a chat activity count object contains the count of temporary activity restrictions, the count of activity restrictions, and the count of chats.
- Return type:
- async remove_restrict()¶
Remove this user to restrict activity.
- async remove_role()¶
Remove a broadcast permission to this user.
Video¶
- class PartialVideo¶
Exceptions¶
- exception LoginRequired¶
Exception that’s raised when a method need login.
- exception HTTPException¶
Exception that’s raised when an HTTP request operation fails.
- exception NotFound¶
Exception that’s raised for when status code 404 occurs.