Proxy Environment Check and Warning | Generated by AI
Added warn_if_proxy_set():
- Checks
http_proxy,https_proxy,HTTP_PROXY,HTTPS_PROXY,all_proxy,ALL_PROXY. - If any is set, prints which vars + values, explains hf-mirror.com doesn’t need a proxy, and shows the exact
unsetcommand. - Runs
curl -m 5 https://www.google.com(which inherits the user’s proxy env) and reports the HTTP code —200means the proxy works but is unneeded; non-200 means it’s probably broken anyway. - Handles missing
curlgracefully (FileNotFoundError). - Called once at the start of
main()before any downloads happen.
Doesn’t abort — just warns, so the user can still proceed if they really want to.