diff --git a/README.md b/README.md index a6583a4..752898e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ To run this container and record streams from Twitch, you need to register a dum The container needs a few configuration parameters. These are: `USERNAME` - name of the streamer you want to record (Change this accordingly!) +`QUALITY` - this uses the streamlink [STREAM](https://streamlink.github.io/cli.html#cmdoption-arg-STREAM) setting to choose the quality to record. `CLIENT_ID` - you can grab this from [here](https://dev.twitch.tv/console/apps) once you register your application (Replace with your own!) `CLIENT_SECRET` - you generate this [here](https://dev.twitch.tv/console/apps) as well, for your registered application (Replace with your own!) `AUTH_TOKEN` - optionally your [OAuth Token](https://streamlink.github.io/cli/plugins/twitch.html#authentication) to prevent ad breaks if you're subscribed to the streamer @@ -22,6 +23,7 @@ Start the container with the following `docker run` command: ```bash docker run -d \ -e USERNAME=your_favourite_streamer \ + -e QUALITY=best \ -e CLIENT_ID=your_client_id \ -e CLIENT_SECRET=your_client_secret \ -e AUTH_TOKEN=your_oauth_token_cookie \ @@ -40,9 +42,5 @@ Open TODOs for future improvements: - [x] Switch to alpine based images - [x] Add "tini" init system - [x] Allow configuration via env variables -- [x] Run process as non-root user -- [ ] Add "latest" tag -- [ ] Run GitHub Action on a regular base -- [ ] Separate container tags for the regular built images? -- [ ] How many versions of the image do i want to store on GitHub? -- [ ] Cross build image for ARM architecture +- [x] Run process as non-root user? +- [ ] Cross build image for ARM architecture? diff --git a/docker-compose.example.yml b/docker-compose.example.yml index c322d83..ce4e328 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -14,6 +14,7 @@ services: GID: 1000 environment: - USERNAME=your_favourite_streamer + - QUALITY=best - CLIENT_ID=your_client_id - CLIENT_SECRET=your_client_secret # - AUTH_TOKEN=your_oauth_token_cookie diff --git a/entrypoint.sh b/entrypoint.sh index 0cd0f6f..ad233db 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,7 @@ # Ensure presence of all needed variables [ -n "${USERNAME}" ] || { echo "USERNAME not given, exit."; exit 1; } +[ -n "${QUALITY}" ] || { echo "QUALITY not given, exit."; exit 1; } [ -n "${CLIENT_ID}" ] || { echo "CLIENT_ID not given, exit."; exit 1; } [ -n "${CLIENT_SECRET}" ] || { echo "CLIENT_SECRET not given, exit."; exit 1; } @@ -9,6 +10,7 @@ cat < /opt/config.py root_path = "/opt/recordings" username = "${USERNAME}" +quality = "${QUALITY}" client_id = "${CLIENT_ID}" client_secret = "${CLIENT_SECRET}" auth_token = "${AUTH_TOKEN}" diff --git a/twitch-recorder.py b/twitch-recorder.py index 033e1ec..4e976a5 100644 --- a/twitch-recorder.py +++ b/twitch-recorder.py @@ -31,7 +31,7 @@ def __init__(self): # user configuration self.username = config.username - self.quality = "best" + self.quality = config.quality # twitch configuration self.client_id = config.client_id