How can I play youtube url while youtube temporary banned in my country?
get a vpn or proxy i guess?
I need to use Proxy. I already read some answer/solution but didn't helped me. (I don't need to use VPN just for youtube url - because VPN decrease speed of internet.)
https://mpv.io/manual/master/#options-ytdl-raw-options
read the manual then.
Nice, I have to do it by myself. Time to try it. Thank you.
I added ytdl-raw-options=proxy=[http://127.0.0.1:3128]
ytdl-raw-options-append=proxy=http://127.0.0.1:3128 didn't worked. (Of course, I've changed the proxies.)
There are two different network requests that happens when fetching e.g. youtube.com content: the ytdl_hook.lua script one which uses youtube-dl to resolve plain, browser looking URLs into a streamable, mime-type aware content URL that ffmpeg can understand, and then there's ffmpeg's native network downloader (http, hls, etc) which takes over from this point on and makes all the subsequent network requests.
Edit: completely forgot the second part of this post, which is this bit of information found on the --ytdl-raw-options= entry of the manual:
A proxy URL can be passed for youtube-dl to use it in parsing the website. This is useful for
geo-restricted URLs. After youtube-dl parsing, some URLs also require a proxy for playback, so this
can pass that proxy information to mpv. Take note that SOCKS proxies aren't supported and https
URLs also bypass the proxy. This is a limitation in FFmpeg.
So yeah, afaik, the current solution is to setup a wrapper shell script/alias that sets both $HTTP_PROXY AND the $HTTPS_PROXY environmental variables.
This is how I use mpv on Windows for bypassing YT geo-restricted content.
Thanks for the explanation. Looks like I have to knowledge to implement ytdl_hook.lua. By the way I tried HTTP but didn't worked. I used free proxy servers. Maybe this is reason mpv didn't played youtube url?