cli.output: remove VLC stream metadata variables #6251
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
VLC allows having custom variables in its --input-title-format parameter value for displaying certain stream metadata, for example
$a
for the stream author metadata or$t
for the stream title metadata.To avoid unintended variable substitution,
$
characters need to be escaped by replacing$
with$$
.https://wiki.videolan.org/Documentation:Format_String/
When Streamlink's --title argument was implemented in 5c3cf57, a workaround was added for VLC, so users could escape a dollar sign with a leading backslash in the --title value, so the resulting
\$$
sequence would be turned back into a regular$
, allowing VLC to interpret stream metadata variables.However, the title value that's passed to
PlayerOutput
is already formatted by the CLI'sFormatter
instance, which means that it can include arbitrary plugin metadata, like stream IDs, author names, category names, stream titles, etc.This means that if the user has for example set
--title
to{title}
and the plugin'stitle
metadata includes the\$
sequence, then this will be turned into a single$
character, making VLC interpret it and its following character as a stream metadata variable.Fix this by removing the flawed dollar sign escape logic.
resolves #4205