Bug 443156 - Support mpv's yt-dl-format as a command line switch
Summary: Support mpv's yt-dl-format as a command line switch
Status: RESOLVED FIXED
Alias: None
Product: Haruna
Classification: Applications
Component: generic (show other bugs)
Version: 0.7.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: george fb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-30 10:09 UTC by Bart Ribbers
Modified: 2022-10-27 22:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Ribbers 2021-09-30 10:09:12 UTC
I use a Firefox browser extension to open all kinds of videos directly in mpv rather than in the browser itself. For this I configured the extension to open mpv with the "--yt-dl-format" switch to configure what resolution I want (it basically calls mpv via the command line). It would be lovely to be able to do the same in Haruna.

It's already possible to do e.g. "haruna <youtube url>", but the `--yt-dl-format` switch is currently not recognized, and you have to configure what quality you want via the application-wide settings rather than for this particular instance.
Comment 1 george fb 2021-09-30 16:09:38 UTC
Settings > Playback
Comment 2 Bart Ribbers 2021-09-30 19:45:13 UTC
I realize I can do that, and I already mentioned that.

> and you have to configure what quality you want via the application-wide settings rather than for this particular instance.

However, that'll change it _for always_ rather than just for this particular time I launch Haruna. Basically I want this command line switch to be an override which gets wiped after I quit the application.
Comment 3 george fb 2022-10-27 22:48:50 UTC
Git commit cbfe262c945df5714f13569472029c500a5b6bc0 by George Florea Bănuș.
Committed on 27/10/2022 at 22:46.
Pushed by georgefb into branch 'master'.

add command line option to override the ytdl format selection setting

this option is in turn overwritten if the GUI setting is changed

M  +16   -7    src/application.cpp
M  +1    -0    src/application.h
M  +10   -0    src/global.cpp
M  +6    -0    src/global.h
M  +8    -1    src/mpv/mpvitem.cpp

https://invent.kde.org/multimedia/haruna/commit/cbfe262c945df5714f13569472029c500a5b6bc0
Comment 4 george fb 2022-10-27 22:53:06 UTC
You can now do 
```
haruna --ytdl-format-selection="bestvideo[height<=160]+bestaudio/best" "https://www.youtube.com/watch?v=3pDpYur3Nwc"
```
 or use the shorter version `--ytdlfs`.