Simple Python livestream recorder with weekly multi-schedule support. Built with GPT-5.3-Codex.
- Python 3.10+
- ffmpeg installed and available in PATH (or set
ffmpeg_pathin config)
Edit config.json:
{
"schedules": [
{
"name": "morning_news",
"source": "https://example.com/news.m3u8",
"day_of_week": "monday",
"start_time": "08:00",
"end_time": "08:30"
},
{
"name": "sports_live",
"source": "https://example.com/sports.m3u8",
"day_of_week": "friday",
"start_time": "20:00",
"end_time": "22:00"
}
],
"output_dir": "recordings",
"ffmpeg_path": "ffmpeg"
}schedules: list of recording schedulesname: schedule label used in output filenamesource: livestream URL (e.g., m3u8/rtmp/http stream)day_of_week: one ofmonday,tuesday,wednesday,thursday,friday,saturday,sundaystart_time: local time inHH:MM(24-hour format)end_time: local time inHH:MM(24-hour format)output_dir: folder where output is savedffmpeg_path: ffmpeg executable name/path
If end_time is earlier than start_time, recording is treated as overnight (ends next day).
python recorder.py --config config.jsonThe script runs continuously, starts each configured recording at its day/time, and saves .mp4 files in output_dir.