MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / build_command

Method build_command

core/models.py:127–143  ·  view source on GitHub ↗
(self, stream_url, user_agent)

Source from the content-addressed store, hash-verified

125 return False
126
127 def build_command(self, stream_url, user_agent):
128
129 if self.is_proxy():
130 return []
131
132 replacements = {
133 "{streamUrl}": stream_url,
134 "{userAgent}": user_agent,
135 }
136
137 # Split the command and iterate through each part to apply replacements
138 cmd = [self.command] + [
139 self._replace_in_part(part, replacements)
140 for part in shlex_split(self.parameters) # use shlex to handle quoted strings
141 ]
142
143 return cmd
144
145 def _replace_in_part(self, part, replacements):
146 # Iterate through the replacements and replace each part of the string

Callers 2

stream_tsFunction · 0.45

Calls 2

is_proxyMethod · 0.95
_replace_in_partMethod · 0.95

Tested by

no test coverage detected