只抓取章节列表

This commit is contained in:
zhl 2019-04-03 17:02:59 +08:00
parent 580654b7aa
commit a32dc33381

View File

@ -168,16 +168,16 @@ const parseOneBook = async (book) => {
return ;
}
await book.save();
let bar = multi.newBar(' '+book.data.name+' [:bar] :percent :etas', {
complete: '=',
incomplete: ' ',
width: 30,
total: chapterList.length
});
// let bar = multi.newBar(' '+book.data.name+' [:bar] :percent :etas', {
// complete: '=',
// incomplete: ' ',
// width: 30,
// total: chapterList.length
// });
for (let chapter of chapterList) {
let obj = await bookChapterInfo(chapter.chapter_id, chapter.crawl_book_id, chapter.lists_id, siteId);
bar.tick(1);
chapter.content = obj.data.content;
// let obj = await bookChapterInfo(chapter.chapter_id, chapter.crawl_book_id, chapter.lists_id, siteId);
// bar.tick(1);
// chapter.content = obj.data.content;
chapter.book_id = bookId;
chapter.site = siteId;
let chapterRecord = new SpiderData({
@ -187,7 +187,6 @@ const parseOneBook = async (book) => {
await chapterRecord.save();
}
book.status = 2;
book.markModified('data');
await book.save();
}
const parseAllBookList = async (sex, ltype) => {