mpv
mpv copied to clipboard
Add auth options as flags
Feature request as it works much better with scripts/aliases:
Add --user= and --pass= for http and maybe other network protocols...Much easier than entering it in the URL directly.
Would be nice to also have a configuration file to specify that for some (HTTP) targets, because modifying the URL every time you click a link gets a bit boring. :-)
I found a workaround but only if you host your own http server and have full access to its config.
You can do something like this in ngnix for example:
in your host.conf
map_hash_bucket_size 256;
map $http_user_agent $auth {
default 0;
"randstring" 1;
}
location /yourlocation/ {
if ($auth = 0) {
return 403;
}
# do stuff here
proxy_pass http://backend;
}
then in your mpv config
--user-agent=randstring
you can then watch video files without having to pass http basic auth credentials each time, the only downside I found so far is that you cannot specify in mpv config to use this user agent only for a specific host group, this will be used everywhere, so use a random string or whatever you like.