Comments (3)
可以给一个详细的步骤吗?
from yuque-exporter.
可以给一个详细的步骤吗?
关键code
for (const object of bookData) {
for (let i = 0; i < object.books.length; i++) {
if (booksId && object.books[i].id ===booksId) {
const book = new Book(object.books[i].id, delNonStdChars(object.books[i].name), object.books[i].slug);
console.log("book",book);
book.root = await getBookDetail(page, book);
book.user_url = object.books[i].user.login
books.push(book);
}
}
}
from yuque-exporter.
根据知识库名称下载特定知识库的步骤
获取知识库的数据结构
"id": *********,
"type": "Book",
"slug": "isowbw",
"name": "**********",
"user_id": *********,
"description": null,
"items_count": 1,
"likes_count": 0,
"watches_count": 0,
"creator_id": ********,
"abilities": {
"read": true,
"update": true,
"modify_setting": true,
"destroy": true,
"share": true,
"read_private": true,
"create_doc": true
},
重点关注的字段
- id 知识库的ID
- name 知识库的名称
关键代码修改
修改文件的路径
src/toc.js
具体代码修改
因为我的知识库全部改成了英文名称,因此,我使用知识库名称过滤。
for (const object of bookData) {
// 定义要导出的知识库名称,
var book_name = "*****";
// 也可以根据知识库的id过滤,也是由知识库名称找到对应的知识库ID。
var book_id = "****";
for (let i = 0; i < object.books.length; i++) {
// 筛选出 特定的知识库,根据知识库名字进行过滤
if (book_name == object.books[i].name)
// if (book_id == object.books[i].id)
{
const book = new Book(object.books[i].id, delNonStdChars(object.books[i].name), object.books[i].slug);
// console.log(`Books information is: `, JSON.stringify(object.books[i]));
// break;
// continue;
book.root = await getBookDetail(page, book);
book.user_url = object.books[i].user.login
books.push(book);
}
}
}
效果
当执行 node main.js之后,就只下载特定的知识库。
from yuque-exporter.
Related Issues (18)
- 下载的时候失败 HOT 2
- Download timeout error HOT 10
- download timed out HOT 7
- 卡在登录这步,一直超时 HOT 10
- MacOS env configuration HOT 2
- 登录需要滑块验证码,参考代码 HOT 1
- 能否把文档最新编辑时间也导出来呢 =。=? HOT 1
- 登录报错 HOT 7
- 下载超时报错
- 这个可以导出别人的公开知识库吗 HOT 1
- 淘宝镜像源到期相关资料---换新的源 HOT 3
- 这个报错PUPPETEER_SKIP_DOWNLOAD 的原因? HOT 2
- 文件名比对不通过导致的Time Out超时问题
- 你好呀,有下面的问题不知道怎么解决 HOT 1
- /api/mine/book_stacks 返回 401 错误 HOT 2
- 一个用户的使用记录和反馈 HOT 1
- Could not find Chrome 要怎么修改puppeteer默认调用的chrome路径呢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yuque-exporter.