
Project Structure
The purpose of this project was to assist a friend working in the YouTube content creation industry by automating and streamlining their video management process. The system automates the storage of live and edited videos, facilitates the organization of older footage, and sends notifications via Discord and email for real-time updates on uploads and broadcasts. It integrates with a Synology NAS for secure storage and ensures smooth data handling through scripts and APIs, reducing manual effort and increasing efficiency in managing content.
Live Video Folder & Edited Video Folder:
- Live video footage being stored in a designated folder, and a separate folder exists for edited videos.
Automation Scripts:
- A transfer script automatically transfers old videos from one folder to another, perhaps for long-term storage or archival purposes.
- A move script automatically downloads broadcasts and integrates with the Naver Chzzk server, likely for data storage or analysis.
Webhook Integration:
- Notifications for broadcast events are sent to Discord via a webhook, ensuring real-time alerts.
- There’s also a log that gets sent to Discord, potentially for tracking or auditing purposes.
Synology NAS Server:
- The system includes a Synology NAS for storing videos, which may be linked to external clients through Synology Drive.
- The NAS server is also integrated with a script for triggering email server alerts.
Diagram

Code Snippets
def record(streamlink_path, media_url, resolution, file_name, file_path, ffmpeg_path, segment_threads, cookies):
try:
app_directory = os.getcwd()
plugin_path = os.path.join(app_directory, "plugins")
chzzk_cookies = f'NID_SES={cookies.get("NID_SES", "")}; NID_AUT={cookies.get("NID_AUT", "")}'
ffmpeg_log_path = os.path.join(app_directory, "logs", f"{file_name}.log")
api_logger.info(f"Start recording...")
api_logger.info(f"File name: {file_name}")
api_logger.info(f"Plugin path : {plugin_path}")
api_logger.info(f"NID_SES cookie: {cookies.get("NID_SES", "")}")
api_logger.info(f"NID_AUT cookie: {cookies.get("NID_AUT", "")}")
# Using a cookie refresh plugin
subprocess.Popen([
streamlink_path,
"--loglevel", "error",
"--plugin-dir", plugin_path,
media_url,
resolution,
"--http-header", f"Cookie={chzzk_cookies}",
"--output", file_path,
"--ffmpeg-copyts",
# "--ffmpeg-verbose", # ffmpeg logging
# "ffmpeg-verbose-path", ffmpeg_log_path,
])
except subprocess.CalledProcessError as e:
api_logger.error(f"Found an error during recording: {e}")
except Exception as e:
api_logger.error(f"Found an unknown error during recording: {e}")