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