woodruffw / ff2mpv

A Firefox/Chrome add-on for playing URLs in mpv.

Home Page:https://addons.mozilla.org/en-US/firefox/addon/ff2mpv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple entrys for ff2mpv in the context menu

CODExNEAT opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
I wanna open my music playlists on YouTube with the parameters --shuffle and --no-video, which means I'm gonna have to do that in terminal and can't use ff2mpv to do that.

Describe the solution you'd like
I would like to be able to add a second entry in the context menu, to which I can add the parameters I need (also being able to name them would be nice).

Describe alternatives you've considered
Using the terminal is an alternative, but then again the whole point of this plugin is to not need the terminal for that kind of thing

Thanks for the request. Similar requests for additional context menu entries have brought up before (and even merged), but were reverted because Firefox merges multiple entries for an extension into a single tree structure, turning every right-click into two clicks.

I'm leaving this open in the event of someone finding a reasonable solution to this (that doesn't result in either the context menu tree or require terrible hacks like installing one extension per menu entry). In the mean time, you could consider modifying the native client to make it more intelligent -- you could use youtube-dl's JSON metadata functionality to determine whether you're on a music playlist, and spawn MPV with whatever options you desire.

Fast config selection on the toolbar button (the one that at this moment plays the current url on mpv). I call it "fast", because it's not an addon config page, else a floating menu with minimum options.

How this can be done? This would be a list of buttons for selecting a "mode" that the user can add, configure or delete. These "modes" would change the args = [] on the ff2mpv.py.

For example:
You could have three modes:

  • Name: Music. args list would look like this: args = ["mpv", "--no-video" "--force-windows=yes" url].
  • Name: Subtitled. args = ["mpv", "--alang=eng,en", "--sub-font-size=40", url]
  • Name: 480p. args = ["mpv", "--ytdl-format=bestvideo[height<=?480]+bestaudio/best", url]

This can be more cleanly done by writing a mpv.conf and adding some profiles.

To config this modes, the user could write the parameters he wants separated by a comma to convert it into a list and add it to the default args args = ["mpv", url].

For not loosing the "display current url on mpv" function, this could be add as an special option on this proposed menu.

This is done with #108. See #105 for more context.

I've cut v5.0.0 with these changes, and the new version should be available on AMO and the Chrome Store shortly.

Many thanks to everyone who has provided technical feedback on this, and to @DanSM-5 in particular for his hard work on this feature!