From e8d949db86b86d28758850d5d5e0beba5e266905 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 9 Jan 2026 23:38:32 -0500 Subject: [PATCH 1/2] replaced standard str.split() with shlex.split() --- core/models.py | 5 ++++- core/views.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/models.py b/core/models.py index b9166f66..bf3f06a5 100644 --- a/core/models.py +++ b/core/models.py @@ -1,4 +1,7 @@ # core/models.py + +from shlex import split as shlex_split + from django.conf import settings from django.db import models from django.utils.text import slugify @@ -133,7 +136,7 @@ class StreamProfile(models.Model): # Split the command and iterate through each part to apply replacements cmd = [self.command] + [ self._replace_in_part(part, replacements) - for part in self.parameters.split() + for part in shlex_split(self.parameters) # use shlex to handle quoted strings ] return cmd diff --git a/core/views.py b/core/views.py index 312d8836..fa1f24ca 100644 --- a/core/views.py +++ b/core/views.py @@ -1,5 +1,6 @@ # core/views.py import os +from shlex import split as shlex_split import sys import subprocess import logging @@ -144,7 +145,7 @@ def stream_view(request, channel_uuid): logger.debug("Formatted parameters: %s", parameters) # Build the final command. - cmd = [stream_profile.command] + parameters.split() + cmd = [stream_profile.command] + shlex_split(parameters) logger.debug("Executing command: %s", cmd) try: From 7594ba0a08015a9344ca6277c4b810222b40acb9 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sun, 11 Jan 2026 20:24:59 -0600 Subject: [PATCH 2/2] changelog: Update changelog for command line parsing PR. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6778217..3d41f63d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed stream profile parameters not properly handling quoted arguments. Switched from basic `.split()` to `shlex.split()` for parsing command-line parameters, allowing proper handling of multi-word arguments in quotes (e.g., OAuth tokens in HTTP headers like `"--twitch-api-header=Authorization=OAuth token123"`). This ensures external streaming tools like Streamlink and FFmpeg receive correctly formatted arguments when using stream profiles with complex parameters - Thanks [@justinforlenza](https://github.com/justinforlenza) (Fixes #833) - Fixed bulk and manual channel creation not refreshing channel profile memberships in the UI for all connected clients. WebSocket `channels_created` event now calls `fetchChannelProfiles()` to ensure profile membership updates are reflected in real-time for all users without requiring a page refresh. - Fixed Channel Profile filter incorrectly applying profile membership filtering even when "Show Disabled" was enabled, preventing all channels from being displayed. Profile filter now only applies when hiding disabled channels. (Fixes #825) - Fixed manual channel creation not adding channels to channel profiles. Manually created channels are now added to the selected profile if one is active, or to all profiles if "All" is selected, matching the behavior of channels created from streams.