jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
543 stars 68 forks source link

does it support proxy? #162

Closed passgall closed 3 years ago

passgall commented 3 years ago

I want to use proxy(socks) with python-mpv. I have seen it should uesd with youtube-dl. Any one can give some examples?

neinseg commented 3 years ago

python-mpv passes through all options to the underlying libmpv. According to the doc, there are two places where you can set proxies.

  1. The embedded youtube-dl that is used for streaming video site playback can be given a proxy through the ytdl-raw-options command-line option. doc here. You can pass this option through python-mpv by passing it to the constructor like so: mpv.MPV(..., ytdl_raw_options="...."). Note the underscores in the option name.
  2. mpv uses ffmpeg for playback. When playing a stream, ffmpeg uses a separate proxy setting set by the http-proxy command-line option, mpv.MPV(..., http_proxy="..."). doc here. Note that the doc on ytdl-raw-options has some inconsistent warnings about SOCKS and HTTPS not being supported.

I hope that helps :)

jaseg commented 3 years ago

I'm closing this issue because it seems it is resolved.