Open Bogdan107 opened 2 years ago
In the way that you are proposing, this will not work simply due to how shell uses variables. (although I do think this would be a nice feature)
you could just add
video_player () {
http_proxy= https_proxy= torsocks -q mpv --ytdl-format="$ytdl_pref" $url_handler_opts "$@"
}
to your ytfzf config.
So whenever you play a video it uses your function instead of the default one.
I configure function video()
as in your example.
Then, normally unavialabled videos are played with ytfzf over tor.
But in this case, ALL VIDEOS are played over the socks-proxy...
I need to play only some videos with proxy, not all videos.
How to join video_player ()
with handle_keypress_alt_y ()
to allow to play only selected videos over the socks proxy?
Move the video player function inside handle_keypress_alt_y
Background
[ yes ] I have checked ytfzf(1) and ytfzf(5) or the wiki before creating this.
Problem
Why do we need this feature? I want to use tor to play some videos. Tor - is a proxy with type socks. I use
handle_keypress_alt_y ()
command for this.But MPV supports only proxy with type http/https. MPV does not support proxy with type socks. Details - https://github.com/mpv-player/mpv/issues/3373.
So, to use socks proxy, I need to use additional http/https proxy-server.
Start of this problem - #547. But my problem was been resolved only partly.
With this feature, I can use socks-proxy to play the video in MPV, which called from ytfzf. This do by usage of the proxyficator program, like torify, proxychains4, tsocks or any other.
Feature
Description of your proposed feature.
Add an option, like
mpv_cmd_prefix
into conf.sh:Example of usage:
With this prefix, the command, which generated inside the ytfzf, which call MPV player, will be prepended with value of
$mpv_cmd_prefix
variable. The result line must be like this:or in expanded version:
Alternative solutions to problem?
Neither mpv, no ytfzf have an options, which allow to use socks-type proxy-server in MPV without usage of external proxy chains
http_proxy -> socks_proxy
.