diff --git a/automaton/devtools.py b/automaton/devtools.py index 86af9c6..48f259b 100644 --- a/automaton/devtools.py +++ b/automaton/devtools.py @@ -34,6 +34,8 @@ class Browser(object): })() '''))['result']['value'])['data'] spider_user = configs['user']['username'] + logger.debug(f'spider: {spider_user}') + logger.debug(f'iSmart client: {json.dumps(user_info, indent=4)}') if spider_user != user_info['mobile'] and spider_user != user_info['username']: logger.warning('检测到 iSmart 客户端中登录的账号与配置文件中账号不符!') choice = input('继续使用可能会出现意料之外的问题,是否继续?[y/N]') diff --git a/automaton/spider/spider.py b/automaton/spider/spider.py index 49ae6d9..d1b52c9 100644 --- a/automaton/spider/spider.py +++ b/automaton/spider/spider.py @@ -1,3 +1,4 @@ +import json from hashlib import md5 from random import random @@ -134,8 +135,9 @@ class Spider(httpx.AsyncClient): params={ 'ticket': ticket } - )).json()['data'] - return paper_info + )).json() + logger.debug(f'paper_info: {json.dumps(paper_info, indent=4)}') + return paper_info['data'] async def user_info(self): logger.info('正在获取用户信息...') @@ -168,4 +170,5 @@ class Spider(httpx.AsyncClient): 'bookType': 0 } )).json() + logger.debug(f'book_info: {json.dumps(book_info, indent=4)}') return book_info['data'] diff --git a/requirements.txt b/requirements.txt index e4cd82c..5f94ee5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ opencv-python~=4.5.3.56 numpy~=1.21.2 httpx~=0.19.0 beautifulsoup4~=4.10.0 -websockets~=10.0 +websockets~=8.1 PyYAML~=5.4.1 \ No newline at end of file