Skip to content

微信读书似乎对renewal 接口增加了额外的验证#106

Open
John-L-CN wants to merge 3 commits intofindmover:mainfrom
John-L-CN:main
Open

微信读书似乎对renewal 接口增加了额外的验证#106
John-L-CN wants to merge 3 commits intofindmover:mainfrom
John-L-CN:main

Conversation

@John-L-CN
Copy link

今天新增加了gotify推送方式后发现无法更新cookie了,换浏览器、重新登录都无法获取新的cookie,删除项目重新fork还是一样,看了下返回信息,微信读书似乎对renewal 接口增加了额外的验证,read 接口直接请求是成功的 ,但 renewal 接口鉴权失败 。稍微修改了一下:

main.py 的修改:
新增 test_cookie_valid() 函数

使用 read 接口直接测试 cookie 是否有效
绕过 renewal 接口的鉴权问题
修改 refresh_cookie() 函数

先尝试 renewal 接口
如果失败,再测试 read 接口
只要有一个成功,就继续阅读
修改初始验证逻辑

启动时先用 test_cookie_valid() 测试 cookie
如果有效,直接开始阅读
如果无效,再尝试刷新
修复编码问题

所有 requests.post 的数据都使用 .encode('utf-8')
避免中文编码错误
添加超时设置

防止请求卡住

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments