This is a Docker Container to record a livestream. It uses the official Debian Image with the Tag sid-slim, installs streamlink, and runs a modified version of the script streamlink-recorder.sh to periodically check if the stream is live.
docker-compose.yaml:
version: "3"
services:
record:
image: kjake/streamlink-recorder
container_name: Streamlink-Recorder
restart: unless-stopped
volumes:
- /volume1/docker/Twitch-recorder/urtwitchstreamer:/home/download
environment:
- streamName=urtwitchstreamer
- streamLink=twitch.tv/urtwitchstreamer
- streamQuality=best
- streamOptions=--twitch-disable-hosting --twitch-disable-ads
- streamPoll=60
- uid=9001
- gid=9001
- TZ=Asia/Seouldocker on cli:
docker run -d \
--name='Streamlink-Recorder' \
-e TZ='Asia/Seoul' \
-e streamLink='twitch.tv/urtwitchstreamer' \
-e streamName='urtwitchstreamer' \
-e streamQuality='best' \
-e streamOptions='--twitch-disable-hosting --twitch-disable-ads' \
-e streamPoll=60 \
-e gid=9001 \
-e uid=9001 \
-v /volume1/docker/Twitch-recorder/urtwitchstreamer:/home/download:rw \
--restart=unless-stopped kjake/streamlink-recorder/home/download - the place where the vods will be saved. Mount it to a desired place with -v option.
/home/script - the place where the scripts are stored. (entrypoint.sh and streamlink-recorder.sh)
/home/plugins - the place where the streamlink plugins are stored.
streamLink - the url of the stream you want to record.
streamQuality - quality options (best, high, medium, low).
streamName - name for the stream.
streamOptions - streamlink flags (--twitch-disable-reruns, separated by space, see Plugins)
streamPoll - freqency (in seconds) to poll streamLink for a new stream.
uid - USER ID, map to your desired User ID (fallback to 9001)
gid - GROUP ID, map to your desired Group ID (fallback to 9001)
Note
The stream file will be named as streamName - Year-Month-Day HourMinuteSecond - streamTitle.mkv.
When building or running pipx install streamlink on architectures where a prebuilt lxml wheel is unavailable (for example, s390x), ensure the Python development headers and XML tooling are present so lxml can compile successfully:
apt-get update && \
apt-get install -y --no-install-recommends \
python3-dev \
libxml2-dev \
libxslt1-dev \
build-essentialThe Dockerfile already installs these dependencies to keep the image build working across multiple architectures.
- Thanks to @lauwarm for the original streamlink container.
If you see out of date documentation, things aren't working, have an idea, etc., you can help out by either:
- creating an issue, or
- sending a pull request with modifications