deppwang / youdaonote-pull Goto Github PK
View Code? Open in Web Editor NEW📝 一个一键导出 / 备份「有道云笔记」所有笔记的 Python 脚本。 A Python script to export/backup all the notes of the "Youdao Note".
License: MIT License
📝 一个一键导出 / 备份「有道云笔记」所有笔记的 Python 脚本。 A Python script to export/backup all the notes of the "Youdao Note".
License: MIT License
首先导出顺利,感谢脚本。
但是发现仍有一种类型的笔记导出结果为不带扩展名的文件,比如下方这则来自微信公众号的笔记:
http://note.youdao.com/noteshare?id=1041bc6f2596ca150b57edccc971d142&sub=96F960F7AF674D24BE8C6523E3051851
其实就是一则平白的图文公众号,导出后变成一个所附近压缩文件中的那个未知文件。
类似的笔记我还有很多。
不知道是否有一个原因在背后,感谢 !
RT
很好用,导出来效果挺不错的
<heading compat="true" level="2">
<coId>7740-1543502828194</coId>
<text>1.2 元注解</text>
<inline-styles>
<bold>
<from>0</from>
<to>7</to>
<value>true</value>
</bold>
<font-size>
<from>0</from>
<to>7</to>
<value>20</value>
</font-size>
</inline-styles>
<styles/>
</heading>
<para>
<coId>5866-1543505640634</coId>
<text>定义注解成员的注意点</text>
<inline-styles>
<bold>
<from>0</from>
<to>10</to>
<value>true</value>
</bold>
<color>
<from>0</from>
<to>4</to>
<value>#df402a</value>
</color>
<color>
<from>5</from>
<to>10</to>
<value>#df412a</value>
</color>
</inline-styles>
<styles/>
</para>
运行错误退出测试
验证 config.json 格式错误(花括号位置),是否结束执行并输出提示
错误提示:请检查「config.json」格式是否为 utf-8 的 json!建议使用 Sublime 编辑「config.json」
已终止执行
.----------------
验证 config.json 格式错误(有注释),是否结束执行并输出提示
错误提示:请检查「config.json」格式是否为 utf-8 的 json!建议使用 Sublime 编辑「config.json」
已终止执行
.----------------
测试 config 的 key 被修改时
错误提示:'请检查「config.json」的 key 是否分别为 username, password, local_dir, ydnote_dir, smms_secret_token'
已终止执行
.----------------
验证账号密码为空时,是否结束执行并输出提示
错误提示:账号密码不能为空,请检查「config.json」!
已终止执行
.----------------
当 ydnote_dir 不存在时,是否结束并提示
E----------------
当 local_dir 错误时(为相对路径),是否结束并提示
E----------------
当 local_dir 错误时(不存在上层文件夹),是否结束并提示
E----------------
有道云笔记修改接口,是否提示
Traceback (most recent call last):
File "test.py", line 235, in test_config_ydnote_dir_err
set_right_cookies()
File "test.py", line 32, in set_right_cookies
with open('cookies-right.json', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'cookies-right.json'
Traceback (most recent call last):
File "test.py", line 255, in test_config_local_dir_err
set_right_cookies()
File "test.py", line 32, in set_right_cookies
with open('cookies-right.json', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'cookies-right.json'
Traceback (most recent call last):
File "test.py", line 275, in test_config_local_dir_err2
set_right_cookies()
File "test.py", line 32, in set_right_cookies
with open('cookies-right.json', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'cookies-right.json'
Traceback (most recent call last):
File "test.py", line 287, in test_get_all_youdao_url_change
with open('config-right.json', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'config-right.json'
Ran 8 tests in 0.007s
运行下载测试
验证 smms_secret_token 为 null 时,是否能完整下载成功
E----------------
验证 smms_secret_token 不为 null 时,是否能完整下载
我的有道云笔记都是使用微信登录的,没有账号和密码,这个需要怎么弄?
感谢开发者,整体上很好用。
两个小问题。
希望可以保留有道云笔记中字体的颜色、加粗等效果
请问如何解决
可以增加一个修改修改图片 地址为自定义的图床
在有道云笔记中删除了的笔记,更新笔记时也删除本地对应的笔记及相关文件
您好,
感谢您的程序,我成功的下载了有道所有的笔记。不过因为我原来的笔记有很多不同的颜色和格式,下载后这些格式在markdown里面无法显示出来。请问有没有可能把所有笔记下载成其他格式呢?
谢谢
建议图片下载到markdown文件同目录,或者只md文件的目录下,建一个和md文件同名的目录放这个md文件的图片,这样比较方便分享单个或者一个目录给别人,谢谢!
1.有序列表内容,导出后消失
2.带标题格式的,导出后也消失了
请问大佬这该如何解决呢?
如题,导出某些文件时抛错:
not enough arguments for format string
已终止执行
似乎是转换有道云图床的图片到本地的时候抛的。
自定义要导出的文件目录,程序读取信息需要设置成“utf-8”,否则会出现中文乱码匹配不上文件夹名
with open('config.json', 'r',encoding="utf-8")
其他读写文件的地方,建议都改成utf-8
请问pull之后还push吗?
RT
没有网易云用户名密码,是使用QQ登录的,使用QQ号密码导出时提示用户名密码错误T-T
咋复制一下能被markdown正确渲染呢?有没有什么解决方案
代码中的45行
if not username or not password or not local_dir or not ydnote_dir or not smms_secret_token:
raise KeyError('请检查「config.json」的 key 是否分别为 username, password, local_dir, ydnote_dir, smms_secret_token')
现在的导出是将图片统一放到youdao-images这个文件夹里,然后md里面引用本地链接。不过这样就导致文件过大时,迁移笔记很容易失败。
请问有没有办法能够让图片直接下载到md和文字在一起。这样我就可以分批导入文件,既不用担心没文字,也不用担心文件过大迁移失败了。
非常有用的工具!
作者您好,我按说明运行,总是如下报错提示。用的Mac系统,config文件是按说明里的例子填的。我换用自己的账号也是一样的错误。通过VPN更换了ip也不行。请问有可能是什么原因吗?
{
"username": "[email protected]",
"password": "12345678",
"local_dir": "",
"ydnote_dir": "",
"smms_secret_token": ""
}
错误提示:请检查账号密码是否正确!也可能因操作频繁导致需要验证码,请切换网络(改变 ip)或等待一段时间后重试!
已终止执行
能否导将Note转成HTML格式,方便二次处理,比如静态web或者是导入到Evernote
有道越来越恶心,关掉了导出通用格式的接口,说白了就是怕用户跑了,客观现实就是我笔记太多了,还真的不好跑
保存到本地的笔记初根目录的外,其余所有目录下的笔记中的图片路径都缺少了一个层级,导致图片无法显示。
如:markdown中写的是
![](./youdaonote-images/XXXXXXXXX.png)
而实际的路径应该是../youdaonote-images/XXXXXXXXX.png
转换为 Markdown 失败!请检查文件!
错误提示:child index out of range
错误提示:'有道云笔记修改了接口地址,此脚本暂时不能使用!请提 issue'
已终止执行
请仓主有空写下Typora + Dropbox + MWeb的使用教程。
我试着先导出有道云笔记到本地电脑上,再同步到dropbox,iPhone端使用mweb查看dropbox文件不成功。原因是同步的文件需要是由MWeb客户端记录的笔记才可(即需要docs和mainlib.db文件才行),如何才能直接用Typora写,然后手机端查看?
好像还不支持qq登陆的方式,呜呜
在只有图片的笔记,导出后正文无图片的引用。看原始的xml文件,是其中无标签,xml内容如下:
<image>
<coId>79cona1426892476168</coId>
<source>https://note.youdao.com/yws/res/6666/9178c110120a22cb4ef6e66ace6729e1</source>
<styles/>
</image>
导致以下的代码没有起作用:
elif 'text' in child2.tag:
# 部分图片无text标签,但有<styles/>
image_name = child2.text
if child2.text is None:
image_name = ''
new_content += f'![%s](%s){nl}{nl}' % (image_name, image_url)
break
建议将这部分修改如下
elif 'text' in child2.tag:
# 部分图片无text标签,但有<styles/>
image_name = child2.text
if child2.text is None:
image_name = ''
new_content += f'![%s](%s){nl}{nl}' % (image_name, image_url)
break
elif 'styles' in child2.tag:
# 解决无text标签,但有<styles/>
image_name = ''
new_content += f'![%s](%s){nl}{nl}' % (image_name, image_url)
break
脚本执行一半遇到这个问题:
RuntimeError Expected object of device type cuda but got device ty.md ,「云笔记原格式为 .note」
not enough arguments for format string
请问,Win10,运行之后出这个是什么原因呢?谢谢
$ python pull.py
▒▒▒▒ config.json ▒▒ʽ▒Ƿ▒▒▒ȷ▒▒
▒▒▒˳▒
「/Users/xxxx.note」转换为 Markdown 失败!请检查文件!
错误提示:child index out of range
转换md报错
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.