This commit is contained in:
jxxghp
2023-10-18 19:26:21 +08:00
parent 2e4536edb6
commit 3d34c26731
55 changed files with 142 additions and 137 deletions

View File

@ -70,7 +70,7 @@ class _ISiteSigninHandler(metaclass=ABCMeta):
# 解码为字符串
return raw_data.decode(encoding)
except Exception as e:
logger.error(f"chardet解码失败{e}")
logger.error(f"chardet解码失败{str(e)}")
return res.text
else:
return res.text

View File

@ -48,7 +48,7 @@ class PTerClub(_ISiteSigninHandler):
try:
sign_dict = json.loads(html_text)
except Exception as e:
logger.error(f"{site} 签到失败,签到接口返回数据异常,错误信息:{e}")
logger.error(f"{site} 签到失败,签到接口返回数据异常,错误信息:{str(e)}")
return False, '签到失败,签到接口返回数据异常'
if sign_dict['status'] == '1':
# {"status":"1","data":" (签到已成功300)","message":"<p>这是您的第<b>237</b>次签到,

View File

@ -141,7 +141,7 @@ class Tjupt(_ISiteSigninHandler):
proxy=proxy,
site=site)
except (FileNotFoundError, IOError, OSError) as e:
logger.debug(f"查询本地已知答案失败:{e},继续请求豆瓣查询")
logger.debug(f"查询本地已知答案失败:{str(e)},继续请求豆瓣查询")
# 本地不存在正确答案则请求豆瓣查询匹配
for value, answer in answers:
@ -236,7 +236,7 @@ class Tjupt(_ISiteSigninHandler):
with open(self._answer_file, 'w') as f:
f.write(formatted_data)
except (FileNotFoundError, IOError, OSError) as e:
logger.debug(f"签到成功写入本地文件失败:{e}")
logger.debug(f"签到成功写入本地文件失败:{str(e)}")
@staticmethod
def _tohash(img, shape=(10, 10)):