nekitdev/gd.py

Allow private server usage in Client.

Closed this issue · 2 comments

It looks like there aren't many ways to set a custom request URL (without modifying the library itself), which could help with tools targeting private GD servers.

You can use the http.change(url=PRIVATE_SERVER_URL) context manager for that.

client = gd.Client()

with client.http.change(url=PRIVATE_SERVER_URL):
    daily = await client.get_daily()

Thanks, it worked.