floydwch / kaggle-cli

(Deprecated, use https://github.com/Kaggle/kaggle-api instead) An unofficial Kaggle command line tool.
MIT License
674 stars 92 forks source link

Feature request Proxy support via cli arg #42

Closed mzavyalov closed 6 years ago

mzavyalov commented 6 years ago

Hi, is it possible to add a proxy support ?

I've added "export https_proxy=my_proxy", but it fails to download

HTTPSConnectionPool(host='www.kaggle.com', port=443): Max retries exceeded with url: /account/login (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8e70ef6f50>: Failed to establish a new connection: [Errno 110] Connection timed out',))

mzavyalov commented 6 years ago

Just a finding. Might be able to pass 'proxies=' into browser.get() and browser.submit() here

floydwch commented 6 years ago

Env variables are case sensitive. Do you export HTTPS_PROXY="proxy's url" or export https_proxy=my_proxy?

Since there is a way to set the proxy for the request, I'm thinking the design of this config. In the meanwhile, could you check your command?

floydwch commented 6 years ago

After my investigation, to add a proxy argument will affect all browser related operations, it involves changes at least 9 locations, and will increase when we add new features.

IMO, the best way to support proxy is following the Requests' advice.

I'll add it to README.