Skip to content

Conversation

@odnar-dev
Copy link

@odnar-dev odnar-dev commented Aug 26, 2021

image

image

used as mpv backend :
image

@odnar-dev odnar-dev marked this pull request as ready for review August 26, 2021 06:34
Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

You are introducing a breaking change of Streamlink's CLI with that. I am not sure if this is worth adding right now. Maybe later when we decide to bump the major release version.

Also, before this can get merged, the tests need to be fixed first, which includes the mocked test setup which is currently not ideal for the title metadata.

@bastimeyer bastimeyer added the CLI label Aug 26, 2021
@odnar-dev odnar-dev requested a review from bastimeyer August 26, 2021 14:33
@bastimeyer
Copy link
Member

After thinking about it again (I only had the diff in mind in my previous comment, sorry), do we want the interpolated --title parameter value in the JSON output, or the individual stream metadata properties?

The --title parameter is just a utility for formatting the window title of the player launched by Streamlink, which is not useful for JSON data, where individual metadata properties make much more sense.

@odnar-dev
Copy link
Author

After thinking about it again (I only had the diff in mind in my previous comment, sorry), do we want the interpolated --title parameter value in the JSON output, or the individual stream metadata properties?

both

The --title parameter is just a utility for formatting the window title of the player launched by Streamlink, which is not useful for JSON data, where individual metadata properties make much more sense.

i have a script that use streamlink as mpv backend instead of youtube-dl for some specific sites like twitch... $
just by typing "mpv %url%"
it run 'streamlink -j url quality' then extract streamurl from the response and passe it to mpv
this is needed so they are no need to call streamlink two times to get the title

@bastimeyer
Copy link
Member

What I am saying is that the JSON data should not include the custom --title stuff but rather the individual values of the plugin metadata, so one who uses the JSON response can read metadata separately, which is impossible with a single string based on the user's --title value. In your case, these single metadata properties can be used and combined for formatting the player window title.

{
  "type": "hls",
  "url": "https://foo",
  "master": "https://bar",
  "headers": {},
  "metadata": {
    "author": ...,
    "category": ...,
    "title": ...,
  }
}

@odnar-dev
Copy link
Author

i am not sure if this is worth adding right now ;
if user wanted only a specific metadata like the author name he can alwayse call streamlink -j --title "{author}" %url% best
if he wanted multiple metadata properties, he probably gonna combine them; so instead of just calling streamlink with the formate he wanted, he gonna need to combine them manually

also this way respect the formate in streamlink config file if i called streamlink -j %url% best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants