Skip to content

Commit

Permalink
fix: aiohttp proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo2011 committed Dec 31, 2023
1 parent 2e8712f commit c3f982d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bilibili_api/utils/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ async def _prepare_request(self, **kwargs) -> dict:
data.add_field(key, val)
config["data"] = data
config.pop("files")
if settings.proxy != "":
config["proxy"] = settings.proxy

return config

Expand Down Expand Up @@ -746,7 +748,7 @@ def get_aiohttp_session() -> aiohttp.ClientSession:
session = __aiohttp_session_pool.get(loop, None)
if session is None:
session = aiohttp.ClientSession(
loop=loop, connector=aiohttp.TCPConnector(verify_ssl=False)
loop=loop, connector=aiohttp.TCPConnector(verify_ssl=False), trust_env=True
)
__aiohttp_session_pool[loop] = session

Expand Down

0 comments on commit c3f982d

Please sign in to comment.