Aedial / novelai-api

Python API for the NovelAI REST API
https://aedial.github.io/novelai-api/
MIT License
129 stars 17 forks source link

Please add proxy setting to connect api #7

Closed zmdyy0318 closed 1 year ago

zmdyy0318 commented 1 year ago

My country access interface is very poor

Aedial commented 1 year ago

Hi, can you try with the proxy_impl branch ? Some helpers have been put in the generate_image.py example, and the aiohttp documentation on proxy should also help a lot: https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support.

zmdyy0318 commented 1 year ago

I have tried connecting my own proxy service and he works fine

# insert proxy address here
api_inst.api.proxy = "http://127.0.0.1:7890"
# insert proxy address auth here
api_inst.api.proxy_auth = None
Aedial commented 1 year ago

Pushed onto the main branch with f5a44481430ff760deb7ed766c0c9a25c4bdd250