Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arbitrary mpv options #2

Open
yuvadm opened this issue Sep 27, 2019 · 9 comments
Open

Support arbitrary mpv options #2

yuvadm opened this issue Sep 27, 2019 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@yuvadm
Copy link
Member

yuvadm commented Sep 27, 2019

Currently the only special mpv option supported is http_headers which is converted to mpv's --http-header-fields argument.

It might be nice to support arbitrary arguments using TOML nested tables with the following library specification:

[foo]
url = "http://example.com/foo.pls"

  [foo.mpv]
  http-header-fields = ["User-Agent: foo"]
  cookies-file = "path/to/cookies"
  hls-bitrate = "no"

Those parameters can then be immediately translated to --key-name args that are passed on to the mpv invocation.

@yuvadm yuvadm added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 27, 2019
@yuvadm
Copy link
Member Author

yuvadm commented Sep 27, 2019

@shaief if you want to get your hands dirty this might be a nice issue to try :)

@zohar-yzgiaev
Copy link
Contributor

zohar-yzgiaev commented Oct 8, 2019

Some unknowns regarding this, waiting for validation on my understanding; this feature should take the TOML configuration from the library that streamlib loads (default or via path specified via command line argument) and take the mpv configuration per URL, so no global configuration supported yet.

@yuvadm
Copy link
Member Author

yuvadm commented Oct 8, 2019

This isn't a global configuration at all. The idea here is that some streams only work given specific parameters, e.g. the Channel 13 stream returns 403 unless it has an Origin HTTP header with the correct value.

We want to be able to support future use cases without explicitly defining them in advance. Does that make sense? @zoharyzgiaev

@nerd190
Copy link

nerd190 commented Feb 19, 2021

This would be appreciated! being able to add --no-video to an audio playlist's toml file would be great!

@yuvadm
Copy link
Member Author

yuvadm commented Feb 19, 2021

@5c0tt-b0t in which cases is --no-video needed?

@nerd190
Copy link

nerd190 commented Feb 20, 2021

For instance, a big percentage of my Youtube use is music. The top link on Youtube (for most songs) is its music video, most (99%) of the time, I do not want to watch this, I just want to listen to the audio only. mpv --no-video does that, it omits the video and plays the URL as if it was one of my own mp3 files.
On the flip-side, perhaps you just want the video instead (think of tablets/TVs used as a displays, or even the user could be deaf), they can use mpv --no-audio to just watch something with no audio.

@yuvadm
Copy link
Member Author

yuvadm commented Feb 20, 2021

@5c0tt-b0t OK that definitely makes sense. This issue is for supporting arbitrary options, but if you'd like to go ahead and add support for something like an audio_only = true option in the library spec I'd love to merge that functionality.

@nerd190
Copy link

nerd190 commented Feb 20, 2021

I apologise! I thought this was to add options to launch mpv with the extra arguments it takes like:

  • --no-video
  • --no-audio
  • --title="my title"
  • --profile="profile 3"
  • etc, etc.

I would like this functionality so I will take a look over at 'library', this may be the excuse I've needed to look at Rust, I've been learning Go, whilst its by no means slow... damn Rust is FAST! (2x faster) and very memory-efficient too!.
Plus, I always preferred FireFox and Mozilla to Chrome and Google 🤣
EDIT: Just noticed library is written in Python, I dont think I'll be much use to you, I'll try, but I have no interest in interpreted languages :'(

@yuvadm
Copy link
Member Author

yuvadm commented Feb 21, 2021

@5c0tt-b0t there are no changes needed in Python, or in the library itself. Only changes needed are in library.rs to support audio_only attribute and player.rs to pass the flag to mpv in case it it true,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants