Skip to content

wlgdev/wlgdl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WLGDL

Lightweight CLI tool for background Twitch & VK stream recording.

📦 :octocat:
description
Table of Contents
  1. 📃 Description
  2. 🪧 Getting Started
  3. ⚠️ How to use
  4. ⬆️ Deployment
  5. 🔗 Reference

📃 Description

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.

(back to top)

Built With

🪧 Getting Started

WLGDL is cross-platform and requires Deno and ffmpeg installed. It is configured via CLI arguments or environment variables.

Prerequisites

  • Deno 2.1 or newer
  • ffmpeg 7.1 or newer (works with >=4, but 7.1+ recommended)

Installation

Clone the repository and install dependencies:

git clone https://github.com/wlgdev/wlgdl.git
cd wlgdl

No 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:all

(back to top)

⚠️ How to use

Basic usage example (records the welovegames channel and saves to ./data):

wlgdl.exe --channel=welovegames --dir="./data"

Parameters

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

FFmpeg Defaults

  • 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}
    

Possible Exceptions

  • Twitch Ads: If device-id is missing or invalid, recordings may include embedded ads or segments might break.
  • VK Token: Some VK videos require a valid vk-token to access the HLS playlist.
  • FFmpeg: Version incompatibility may cause HLS download issues. Ensure ffmpeg is in your PATH or specified via --bin.

(back to top)

⬆️ Deployment

Build the binary for your platform using Deno tasks:

deno task build:win
deno task build:linux

Or run directly with Deno as shown above.

(back to top)

🔗 Reference

(back to top)

About

CLI tool to record streams in a background

Resources

License

Stars

Watchers

Forks

Packages

No packages published