39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
import json
|
|
import yaml
|
|
|
|
# Load the channels from channels.json
|
|
with open("channels.json", "r") as f:
|
|
channels = json.load(f)
|
|
|
|
compose = {
|
|
"services": {}
|
|
}
|
|
|
|
# For each channel, create a service entry
|
|
for channel in channels:
|
|
service_name = f"scanner_{channel['name']}"
|
|
compose["services"][service_name] = {
|
|
"image": "t0is/madmonq-transcriptor-image:latest",
|
|
"environment": [
|
|
f"CHANNEL_NAME={channel['name']}",
|
|
f"CHANNEL_LANGUAGE={channel['language']}",
|
|
"TIMEDELTA_DAYS=6",
|
|
"TIMEDELTA_DAYS_EXACT=true",
|
|
"TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov",
|
|
"TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es"
|
|
],
|
|
"volumes": [
|
|
"/shared/transcriptor/clips:/app/clips", # Shared clips folder on the host
|
|
"/shared/transcriptor/vods:/app/vods",
|
|
"/shared/transcriptor/audio:/app/audio",
|
|
"/shared/transcriptor/chat:/app/chat",
|
|
"/shared/transcriptor/models:/app/models",
|
|
"/shared/transcriptor/transcripts:/app/transcripts"
|
|
]
|
|
}
|
|
|
|
# Write the docker-compose file
|
|
with open("docker-compose.yml", "w") as f:
|
|
yaml.dump(compose, f, default_flow_style=False)
|
|
|
|
print("docker-compose.yml generated successfully.") |