lyg
2024-06-12 9a6863116bfd8d5733cb1b1b426a8551076dff65
修改日志解析
2个文件已删除
2个文件已修改
33 ■■■■ 已修改文件
.gitignore 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
failed-book-urls.txt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
failed-books.txt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/parse-log.mjs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -2,4 +2,8 @@
**/*.xlsx
downloads
**/*.log
logs
logs
failed-book-urls.txt
failed-books.txt
no-file-books.txt
not-found-books.txt
failed-book-urls.txt
File was deleted
failed-books.txt
File was deleted
src/parse-log.mjs
@@ -53,6 +53,11 @@
          }
          continue;
        }
        reg = /.*没有搜索结果.*/g;
        if (reg.test(line)) {
          book.notFound = true;
          continue;
        }
      }
    }
@@ -71,4 +76,10 @@
  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);
}