lyg
2024-07-13 42295152e10773a2bd394ac14f6feb2c4bc501a7
src/parse-log.mjs
@@ -53,6 +53,11 @@
          }
          continue;
        }
        reg = /.*没有搜索结果.*/g;
        if (reg.test(line)) {
          book.notFound = true;
          continue;
        }
      }
    }
@@ -71,4 +76,13 @@
  const failedBookUrls = books.filter(book => !book.download && book.downloadUrl)
    .map(book => book.downloadUrl).join('\n');
  fs.writeFileSync('./failed-book-urls.txt', failedBookUrls);
  const notFoundBooks = books.filter(book => book.notFound).map(book => book.bookId).join('\n');
  fs.writeFileSync('./not-found-books.txt', notFoundBooks);
  const noFileBooks = books.filter(book => !book.download && !book.downloadUrl).map(book => book.bookId).join('\n');
  fs.writeFileSync('./no-file-books.txt', noFileBooks);
  const successBooks = books.filter(book => book.download).map(book => book.bookId).join('\n');
  fs.writeFileSync('./success-books.txt', successBooks);
}