Add config.py module to read user settings from config.json (not tracked
by git). Proxy URL and request timeout are no longer hard-coded.
Configuration priority:
1. config.json 'civitai.proxy' — explicit user setting
2. HTTP_PROXY/HTTPS_PROXY environment variables — fallback
3. No proxy — if neither is set
Files added:
- config.py — configuration loader with get_proxy_url() and get_timeout()
- config.json.example — template showing available options
Files modified:
- civitai_client.py — uses config.py instead of hard-coded values;
proxy is passed explicitly to each request
- .gitignore — ignores config.json so user settings survive updates
Users in regions where Civitai is blocked can copy config.json.example
to config.json and adjust proxy settings without touching source code.
7 lines
87 B
JSON
7 lines
87 B
JSON
{
|
|
"civitai": {
|
|
"proxy": "http://127.0.0.1:7890",
|
|
"timeout_seconds": 30
|
|
}
|
|
}
|