Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cli.output: remove VLC stream metadata variables#6251

Merged
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:cli/output/remove-vlc-title-variables
Oct 17, 2024
Merged

cli.output: remove VLC stream metadata variables#6251
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:cli/output/remove-vlc-title-variables

Conversation

@bastimeyer

Copy link
Copy Markdown
Member

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's Formatter 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's title 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

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's `Formatter` 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's `title` 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.

@gravyboat gravyboat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change!

@bastimeyer bastimeyer merged commit 14eb46a into streamlink:master Oct 17, 2024
@bastimeyer bastimeyer deleted the cli/output/remove-vlc-title-variables branch October 17, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Player variables in --title

2 participants