Skip to content

A Python script to start/stop recording when CHZZK channel start/stop streaming.

Notifications You must be signed in to change notification settings

billy0402/chzzk-obs-recorder

Repository files navigation

chzzk-obs-recorder

A Python script to start/stop recording when CHZZK channel start/stop streaming.

Start recording Start recording

Stop recording Stop recording

Development environment

Installation

$ pip install -r requirements.txt
# or
$ pipenv install

Setup environment variables

$ cp .env.example .env
Variable Type Default Value Description
TIME_DELAY Integer 10 Time delay (in seconds) for checking the channel status
CHZZK_AUTH String NID_AUT of CHZZK
CHZZK_SESSION String NID_SES of CHZZK
CHZZK_CHANNEL_ID String Channel ID of CHZZK
OBS_WEBSOCKET_HOST String "localhost" Hostname or IP of the OBS WebSocket
OBS_WEBSOCKET_PORT Integer 4455 Port of the OBS WebSocket
OBS_WEBSOCKET_PASSWORD String "" Password of the OBS WebSocket
OBS_WEBSOCKET_TIMEOUT Integer 3 Connection timeout (in seconds) to the OBS WebSocket
LINE_NOTIFY_ACCESS_TOKEN Optional[String] None Access token for LINE Notify, or LINE Notify won't send

You can retrieve NID_AUT and NID_SES from browser cookie using https://chzzk.naver.com after logging in.

You can obtain the channel ID from the CHZZK channel URL.

For example, 아야츠노 유니's URL is https://chzzk.naver.com/45e71a76e949e16a34764deb962f9d9f, and the channel ID is 45e71a76e949e16a34764deb962f9d9f.

The environment variables for OBS WebSocket should match your OBS WebSocket settings.

You can obtain access_token from LINE Notify, the API document https://notify-bot.line.me/doc/en/.

Setup OBS WebSocket

This project is using OBS WebSocket APIs to control OBS.

So you need to setup OBS WebSocket to allow the script to connect to OBS.

obs-websocket is now included by default with OBS Studio 28.0.0 and above.

If your OBS is not that new, please install it by yourself from this link.

OBS WebSocket setup

You should update the environment variables with your OBS WebSocket settings.

Setup OBS scene

You should set up OBS scene by yourself.

This script will only trigger the start and stop recording with OBS.

Usage

$ cd <path-to-chzzk-obs-recorder>

$ python src/main.py

Common Error

WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)

This is a win_toaster issue, dependent on this issue: Windows-10-Toast-Notifications issue.

We won't change the package behavior.

If there is another solution to fix it, please let me know.


If you're using Windows, the environment variables might not update normally.

Please check whether the notification showing the channel message is correct, or restart the terminal.

Please use the Command Prompt (CMD) outside the IDE, as the terminal inside the IDE always has problems even after restarting the computer.


Ctrl + C may not stop the loop immediately.

Please try more times to stop the process.

If it still does not stop, please close the terminal.

And check if OBS has stopped recording.

Bugs and suggestions

If you have found a bug or have a request for additional functionality, please use the issue tracker on GitHub.

https://github.com/billy0402/chzzk-obs-recorder/issues

About

A Python script to start/stop recording when CHZZK channel start/stop streaming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages