python-vlc icon indicating copy to clipboard operation
python-vlc copied to clipboard

Can I add HTTP proxy in python-vlc?

Open Darcy-C opened this issue 4 years ago • 10 comments

I found a HTTP proxy option in VLC, but I do not know how to set that in python-vlc. Is there any docs about setting proxy?

Thank you very much.

Darcy-C avatar Feb 15 '21 06:02 Darcy-C

There is no proxy-related option in libvlc per se, but it should use the http_proxy environment variable if it is set. So you can import os ; os.environ['http_proxy'] = 'http://whatever/' before instanciating libvlc.

oaubert avatar Feb 15 '21 08:02 oaubert

Thank you for your reply. It seems like not working when adding the lines you mentioned. (It seems like libvlc are not using python environ value)

Darcy-C avatar Feb 15 '21 09:02 Darcy-C

Try setting the proxy from the command line, like

env http_proxy='http://whatever...' python vlc.py ...

Or perhaps use capitals like env HTTP_PROXY=....

mrJean1 avatar Feb 15 '21 17:02 mrJean1

Try setting the proxy from the command line, like

env http_proxy='http://whatever...' python vlc.py ...

Or perhaps use capitals like env HTTP_PROXY=....

Thank you for your reply. It does not work. I thought it would be very hard to put a proxy setting to a third party library :c

Darcy-C avatar Feb 15 '21 18:02 Darcy-C

Try setting the proxy from the command line, like env http_proxy='http://whatever...' python vlc.py ... Or perhaps use capitals like env HTTP_PROXY=....

Thank you for your reply. It does not work. I thought it would be very hard to put a proxy setting to a third party library :c

have you resolved this problem?

passgall avatar May 10 '21 06:05 passgall

Try setting the proxy from the command line, like env http_proxy='http://whatever...' python vlc.py ... Or perhaps use capitals like env HTTP_PROXY=....

Thank you for your reply. It does not work. I thought it would be very hard to put a proxy setting to a third party library :c

have you resolved this problem?

I have not resolved this. Sorry.😥

Darcy-C avatar May 10 '21 06:05 Darcy-C

Try setting the proxy from the command line, like env http_proxy='http://whatever...' python vlc.py ... Or perhaps use capitals like env HTTP_PROXY=....

Thank you for your reply. It does not work. I thought it would be very hard to put a proxy setting to a third party library :c

have you resolved this problem?

I have not resolved this. Sorry.

If you have some other replace solutions? I want to view youtube videos with pyqt.I have not find other lib or tools which can embed in?Can you tell me your solution?

passgall avatar May 10 '21 07:05 passgall

Try setting the proxy from the command line, like env http_proxy='http://whatever...' python vlc.py ... Or perhaps use capitals like env HTTP_PROXY=....

Thank you for your reply. It does not work. I thought it would be very hard to put a proxy setting to a third party library :c

have you resolved this problem?

I have not resolved this. Sorry.

If you have some other replace solutions? I want to view youtube videos with pyqt.I have not find other lib or tools which can embed in?Can you tell me your solution?

Yes. If you are using pyqt, QtWebEngineWidgets is an option, which is just a browser, you can use web technology directly. I think it will fit your need very well.

Darcy-C avatar May 10 '21 17:05 Darcy-C

Try setting the proxy from the command line, like env http_proxy='http://whatever...' python vlc.py ... Or perhaps use capitals like env HTTP_PROXY=....

Thank you for your reply. It does not work. I thought it would be very hard to put a proxy setting to a third party library :c

have you resolved this problem?

I have not resolved this. Sorry.

If you have some other replace solutions? I want to view youtube videos with pyqt.I have not find other lib or tools which can embed in?Can you tell me your solution?

Yes. If you are using pyqt, QtWebEngineWidgets is an option, which is just a browser, you can use web technology directly. I think it will fit your need very well.

maybe python-mpv was a nice opiton! I have test it with proxy.

passgall avatar May 13 '21 09:05 passgall

The only way is to use the config file. --http-proxy command line option doesn't work, maybe because it is grabbed directly from config. Works for windows only though, in other systems VLC relies on OS proxy settings.

https://gist.github.com/vzhd1701/f8f8b2ee7b83baaa85fde4e37f02e3e6

vzhd1701 avatar Jun 01 '22 06:06 vzhd1701