mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
响应解码问题处理
This commit is contained in:
@@ -65,6 +65,10 @@ async def fetch(session, url, semaphore):
|
|||||||
allow_redirects=config.get_redirects,
|
allow_redirects=config.get_redirects,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
proxy=config.get_proxy) as resp:
|
proxy=config.get_proxy) as resp:
|
||||||
|
|
||||||
|
try:
|
||||||
|
text = await resp.text(encoding='gb2312') # 先尝试用fb2312解码
|
||||||
|
except UnicodeDecodeError:
|
||||||
text = await resp.text()
|
text = await resp.text()
|
||||||
return resp, text
|
return resp, text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user