mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
更加兼容的解码方式
This commit is contained in:
@@ -92,9 +92,9 @@ async def fetch(session, url):
|
|||||||
proxy=config.get_proxy) as resp:
|
proxy=config.get_proxy) as resp:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = await resp.text(encoding='gb2312') # 先尝试用fb2312解码
|
text = await resp.text(encoding='gb18030') # 先尝试用gb18030解码
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
text = await resp.text(errors='ignore')
|
text = await resp.text(encoding='utf-8', errors='ignore')
|
||||||
return resp, text
|
return resp, text
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return e
|
return e
|
||||||
|
|||||||
Reference in New Issue
Block a user