Skip to content

Commit 90535b0

Browse files
authored
[FIX] 修复了因为路径和数据格式问题导致的无法登录,及无法获取笔记列表的问题 (#39)
* [FIX] 修复了因为路径和数据格式问题导致的无法登录,及无法获取笔记列表的问题
1 parent ef29068 commit 90535b0

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def save_cookie(self, cookie):
126126
logger.info(self.cookies)
127127

128128
def dump_cookies(self):
129-
with open(self.cache_path + "./Cookies", "w") as f:
129+
with open(os.path.join(self.cache_path, "Cookies"), "w") as f:
130130
f.write(";".join([f"{k}:{v}" for k, v in self.cookies.items()]))
131131

132132
def load_cookies(self):

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pyside6~=6.5.0
22
requests~=2.26.0
3+
loguru

wereader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ def get_bookshelf(cookies):
132132
data = r.json()
133133
else:
134134
raise Exception(r.text)
135+
finishReadBooks = [b for b in data["finishReadBooks"] if 'bookId' in b]
136+
recentBooks = [b for b in data["recentBooks"] if 'bookId' in b]
135137
books = set()
136-
for book in chain(data["finishReadBooks"], data["recentBooks"]):
138+
for book in chain(finishReadBooks, recentBooks):
137139
if not book["bookId"].isdigit(): # 过滤公众号
138140
continue
139141
try:

0 commit comments

Comments
 (0)