Skip to content

Commit

Permalink
Merge remote-tracking branch 'stefomat/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkody committed May 23, 2023
2 parents 15f0a07 + 9bbd810 commit 76d6e25
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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?
1 change: 1 addition & 0 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

# 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; }

# Write config.py config file from Docker env variables
cat <<EOF > /opt/config.py
root_path = "/opt/recordings"
username = "${USERNAME}"
quality = "${QUALITY}"
client_id = "${CLIENT_ID}"
client_secret = "${CLIENT_SECRET}"
auth_token = "${AUTH_TOKEN}"
Expand Down
2 changes: 1 addition & 1 deletion twitch-recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76d6e25

Please sign in to comment.