Lightweight CLI tool for background Twitch & VK stream recording.
Table of Contents
WLGDL is a simple CLI tool that runs in the background and records streams automatically. It polls Twitch and VK Video Live simultaneously, detects new streams, and downloads them using ffmpeg. It handles graceful shutdowns (sending 'q' to ffmpeg) and provides an HTTP server to trigger status checks or recordings.
WLGDL is cross-platform and requires Deno and ffmpeg installed. It is configured via CLI arguments or environment variables.
Clone the repository and install dependencies:
git clone https://github.com/wlgdev/wlgdl.git
cd wlgdlNo additional install steps are required. You can run the tool directly with Deno:
deno task start [ARGS]Or build binaries:
deno task build:win
deno task build:linux
deno task build:allBasic usage example (records the welovegames channel and saves to ./data):
wlgdl.exe --channel=welovegames --dir="./data"| Name | Description | Default |
|---|---|---|
| --channel | Channel slug/ID to check on both Twitch and VK | welovegames |
| --dir | Target directory to place recorded streams | ./ (current dir) |
| --format | Target resolution (e.g. 1080p60). Falls back to best if not found. |
1080p60 |
| --ext | Extension for recorded files | mp4 or aac based on mode |
| --device-id | Twitch: Logged in user's Device ID (avoids ads) | .env value or empty |
| --vk-token | VK: Access Token (required for some VK streams) | undefined |
| --bin | Path to the ffmpeg binary | ffmpeg for Linux, ./ffmpeg.exe for Windows |
| --ffmpeg | Custom ffmpeg command string | (interactive selection / see defaults) |
| --tg-token | Telegram Bot token for notifications | undefined |
| --tg-id | Telegram user ID to send notifications to | undefined |
| --ip | IP for HTTP server (trigger check by GET request) | undefined |
| --port | Port for HTTP server | undefined |
| --http_delay | Delay between HTTP request and start of recording (ms) | 500 |
- VIDEO COPY (default)
-loglevel fatal -stats -timeout 15000000 -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 3 -reconnect_max_retries 10 -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" -seg_max_retry 5 -i {url} -c copy {file} - AUDIO COPY
-loglevel fatal -stats -timeout 15000000 -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 3 -reconnect_max_retries 10 -i {url} -seg_max_retry 5 -map 0:a:0 -c:a copy -copyts {file} - AUDIO TRANSCODING
-loglevel fatal -stats -timeout 15000000 -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 3 -reconnect_max_retries 10 -i {url} -seg_max_retry 5 -map 0:a:0 -af asetpts=PTS-STARTPTS -c:a aac -q:a 5 -avoid_negative_ts make_zero -fflags +genpts {file}
- Twitch Ads: If
device-idis missing or invalid, recordings may include embedded ads or segments might break. - VK Token: Some VK videos require a valid
vk-tokento access the HLS playlist. - FFmpeg: Version incompatibility may cause HLS download issues. Ensure
ffmpegis in your PATH or specified via--bin.
Build the binary for your platform using Deno tasks:
deno task build:win
deno task build:linuxOr run directly with Deno as shown above.