{"id":13488882,"url":"https://github.com/gxr404/yuque-dl","last_synced_at":"2025-05-14T08:06:47.946Z","repository":{"id":188436872,"uuid":"678274388","full_name":"gxr404/yuque-dl","owner":"gxr404","description":"yuque 语雀知识库下载","archived":false,"fork":false,"pushed_at":"2025-04-19T09:31:20.000Z","size":2062,"stargazers_count":1187,"open_issues_count":16,"forks_count":190,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-12T20:52:16.299Z","etag":null,"topics":["cli","download","markdown","nodejs","yuque","yuque-dl"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gxr404.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-14T07:05:04.000Z","updated_at":"2025-05-12T15:21:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"39393abd-c239-4e31-a475-bc27e5df9f76","html_url":"https://github.com/gxr404/yuque-dl","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":"0.021739130434782594","last_synced_commit":"72d5831fb9a54d8046b96b8a881cdacb8b6f2685"},"previous_names":["gxr404/yuque-dl"],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxr404%2Fyuque-dl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxr404%2Fyuque-dl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxr404%2Fyuque-dl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxr404%2Fyuque-dl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gxr404","download_url":"https://codeload.github.com/gxr404/yuque-dl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101618,"owners_count":22014909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","download","markdown","nodejs","yuque","yuque-dl"],"created_at":"2024-07-31T18:01:23.498Z","updated_at":"2025-05-14T08:06:42.924Z","avatar_url":"https://github.com/gxr404.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# yuque-dl\n\n语雀知识库下载为本地markdown\n\n![header](https://socialify.git.ci/gxr404/yuque-dl/image?description=1\u0026descriptionEditable=%E8%AF%AD%E9%9B%80%E7%9F%A5%E8%AF%86%E5%BA%93%E4%B8%8B%E8%BD%BD\u0026issues=1\u0026logo=https%3A%2F%2Fraw.githubusercontent.com%2Fgxr404%2Fyuque-dl%2Fmain%2Fdocs%2Fassets%2Flogo.png\u0026name=1\u0026pattern=Circuit%20Board\u0026pulls=1\u0026stargazers=1\u0026theme=Light)\n\n## Prerequisite\n\n- Node.js 18.4 or later\n\n## Install\n\n```bash\nnpm i -g yuque-dl\n```\n\n## Usage\n\n```bash\n$ yuque-dl --help\n\n  Usage:\n    $ yuque-dl \u003curl\u003e\n\n  Commands:\n    \u003curl\u003e                语雀知识库url\n    server \u003cserverPath\u003e  启动web服务\n\n  For more info, run any command with the `--help` flag:\n    $ yuque-dl --help\n    $ yuque-dl server --help\n\n  Options:\n    -d, --dist-dir \u003cdir\u003e         下载的目录 eg: -d download (default: download)\n    -i, --ignore-img             忽略图片不下载 (default: false)\n    -k, --key \u003ckey\u003e              语雀的cookie key， 默认是 \"_yuque_session\"， 在某些企业版本中 key 不一样\n    -t, --token \u003ctoken\u003e          语雀的cookie key 对应的值\n    --toc                        是否输出文档toc目录 (default: false)\n    --incremental                开启增量下载(初次下载加不加该参数没区别) (default: false)\n    --convertMarkdownVideoLinks  转化markdown视频链接为video标签 (default: false)\n    --hideFooter                 是否禁用页脚显示(更新时间、原文地址...) (default: false)\n    -h, --help                   Display this message\n    -v, --version                Display version number\n```\n\n### Start\n\n```bash\n# url 为对应需要的知识库地址\nyuque-dl \"https://www.yuque.com/yuque/thyzgp\"\n```\n\n## Example\n\n![demo](https://github.com/gxr404/yuque-dl/assets/17134256/98fbbc81-91d4-47f8-9316-eb0ef060d6be)\n\n## 其他场景\n\n### 私有知识库\n\n通过别人私有知识库 分享的链接，需使用`-t`添加token才能下载\n\n```bash\nyuque-dl \"https://www.yuque.com/yuque/thyzgp\" -t \"abcd...\"\n```\n\n[token的获取请看](./docs/GET_TOEKN.md)\n\n### 企业私有服务\n\n企业服务有自己的域名(黄色语雀logo)，非`yuque.com`结尾, 如`https://yuque.antfin.com/r/zone`\n\n这种情况 token的key不唯一, 不一定是为`_yuque_session` 需用户使用 `-k` 指定 token的key,`-t` 指定 token的值。\n\n至于`key`具体是什么只能靠用户自己在 `浏览器Devtools-\u003e Application -\u003e Cookies` 里找了🤔\n\n### 公开密码访问的知识库\n\n\u003e [!WARNING]\n\u003e 下载\"公开密码访问的知识库\" 前提是需要知道别人设置的密码，输入密码后拿cookie进行下载，**无法做到破解密码**, 请须知\n\n![public_pwd](https://github.com/gxr404/yuque-dl/assets/17134256/b546a9a3-68f0-4f76-b450-6b16f464db5d)\n\n⚠️ 公开密码访问的知识库两种情况:\n\n- 已经登录语雀，访问需要密码的知识库 输入密码后使用`_yuque_session`这个cookie\n\n    ```bash\n    yuque-dl \"url\" -t \"_yuque_session的值\"\n    ```\n\n- 未登录语雀，访问需要密码的知识库 输入密码后需要使用`verified_books`/`verified_docs`这个cookie\n\n    ```bash\n    yuque-dl \"url\" -k \"verified_books\" -t \"verified_books的值\"\n    ```\n\n## 内置启动web服务可快速预览\n\n使用[`vitepress`](https://vitepress.dev/)快速启动一个web服务提供可预览下载的内容\n\n```bash\nyuque-dl server ./download/知识库/\n\n➜  Local:   http://localhost:5173/\n➜  Network: use --host to expose\n```\n\n![server](https://github.com/gxr404/yuque-dl/assets/17134256/6d3a06cd-20b1-4eca-ae75-d9a90614336f)\n\n## Feature\n\n- [x] 支持下载中断继续\n- [x] 支持图片下载本地\n- [x] 支持下载分享私有的知识库\n- [x] 支持转换表格类型的文档 (ps: 表格内插入图表暂不支持)\n- [x] 添加toc目录功能\n- [x] 添加测试\n- [x] 添加附件下载\n- [ ] 支持其他文档类型？🤔\n- [ ] 直接打包成可执行文件 🤔\n\n## 常见错误\n\n1. 由于token可能含有 特殊字符导致参数识别错误\n\n```bash\nyuque-dl \"https://www.yuque.com/yuque/thyzgp\" -t \"-a123\"\nyuque-dl [ERROR]: Unknown option `-1`\n```\n\n解决方案\n\n```bash\nyuque-dl \"https://www.yuque.com/yuque/thyzgp\" -t=\"-a123\"\n```\n\n2. 附件下载失败，需设置登录token\n\n附件文件下载需要用户登录token，即使是完全公开的知识库，下载附件也可能需要\n\n完全公开的知识库未登录的情况下查看附件:\n\n![attachments](https://github.com/user-attachments/assets/6e764abf-0da6-4fb8-ab96-7d027830b291)\n\n## Tips\n\n由于网络波动下载失败的，重新运行即可，已下载的进度不会受到影响\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgxr404%2Fyuque-dl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgxr404%2Fyuque-dl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgxr404%2Fyuque-dl/lists"}