DeppWang / youdaonote-pull

📝 一个一键导出 / 备份「有道云笔记」所有笔记的 Python 脚本。 A Python script to export/backup all the notes of the "Youdao Note".
MIT License
1.34k stars 292 forks source link

登录失败,换了IP无效,到VPS上操作也是这样 #63

Closed Diliya closed 2 years ago

Diliya commented 2 years ago

WARNING:urllib3.connectionpool:Failed to parse headers (url=https://note.youdao.com:443/web/): [MissingHeaderBodySeparatorDefect()], unparsed data: 'age=0\r\n\r\n' Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 469, in _make_request assert_header_parsing(httplib_response.msg) File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\response.py", line 91, in assert_header_parsing raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data) urllib3.exceptions.HeaderParsingError: [MissingHeaderBodySeparatorDefect()], unparsed data: 'age=0\r\n\r\n' 错误提示:请检查账号密码是否正确!也可能因操作频繁导致需要验证码,请切换网络(改变 ip)或等待一段时间后重试!

DeppWang commented 2 years ago

应该有道云笔记改了接口,我后面修复一下,可以先尝试用 cookie 登录,参考 #32

Diliya commented 2 years ago

试了下cookies登录,还是提示 错误提示:请检查账号密码是否正确!也可能因操作频繁导致需要验证码,请切换网络(改变 ip)或等待一段时间后重试! 就好像还是用账号密码登录得一样,在github找到另一个人的脚本,他的也是用的cookies登录,不过他的只需要YNOTE_SESS和YNOTE_LOGIN两个参数,能登陆成功,但是导出了一点就报错

Diliya commented 2 years ago

拿VS Code开着调试跑了一下,看起来还是服务器连不上 发生异常: SystemExit 1 File "[F:\youdaonote-pull-master\pull.py]()", line 717, in main root_id = session.check_and_login(config_dict['username'], config_dict['password']) File "[F:\youdaonote-pull-master\pull.py]()", line 125, in check_and_login root_id = self.login(username, password) File "[F:\youdaonote-pull-master\pull.py]()", line 167, in login raise LoginError('请检查账号密码是否正确!也可能因操作频繁导致需要验证码,请切换网络(改变 ip)或等待一段时间后重试!')

During handling of the above exception, another exception occurred:

File "[F:\youdaonote-pull-master\pull.py]()", line 734, in main sys.exit(1) File "[F:\youdaonote-pull-master\pull.py]()", line 746, in main() 终端输出的内容 Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\Users\admin.vscode\extensions\ms-python.python-2022.4.0\pythonFiles\lib\python\debugp main() File "c:\Users\admin.vscode\extensions\ms-python.python-2022.4.0\pythonFiles\lib\python\debugpy\launcher__main.py", line 53, in main launcher.connect(host, port) File "c:\Users\admin.vscode\extensions\ms-python.python-2022.4.0\pythonFiles\lib\python\debugpy\launcher/../..\debugpy\launcher\init__.py", line 34, in connect sock.connect((host, port)) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 PS F:\youdaonote-pull-master> f:; cd 'f:\youdaonote-pull-master'; & 'C:\Users\admin\AppData\Local\Programs\Python\Python310\python.exe' 'c:\Users\admin.vscode\extensions\ms-python.python-2022.4.0\pythonFiles\lib\python\debugpy\launcher' '56542' '--' 'f:\youdaonote-pull-master\pull.py'
错误提示:请检查账号密码是否正确!也可能因操作频繁导致需要验证码,请切换网络(改变 ip)或等待一段 时间后重试! 已终止执行

DeppWang commented 2 years ago

这个报错是你设置 cookies.json 没有设置对

Diliya commented 2 years ago

那是cstk没设置的原因吗?浏览器里没有找到cstk,我把cookies.json里那一段给删了

DeppWang commented 2 years ago

YNOTE_CSTK 不是必须的,只要保证 YNOTE_LOGINYNOTE_SESS 设置对就行