npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

book-spider

v1.5.0

Published

a tool for downloading book

Downloads

8

Readme

book-spider

✨ 特性

📂 批量下载

🔄 章节获取失败重试

⏸ 顺序下载 断点断续

▶️ 可自由配置的并发控制

📑 美观的信息提示

⚡ 采用异步并发方式获取页面数据

🈚 去除书籍中的广告

🔧 可配置书籍来源网站

❓ 完善的帮助信息

💡 使用方法

需要 Node 版本 >= 14.0.0

$ npm i book-spider -g
$ bs -v # 查看版本号
$ bs -h # 查看帮助
$ bs [小说名] # 下载小说

默认会自动选择最快书源,若要指定书源


$ bs --source [url] [小说名]
$ bs -s [url] [小说名]
$ bs list # 查看支持的书源

支持批量下载 小说名之间用空格分开

$ bs [小说名] [小说名] ...

顺序下载模式,按章节顺序写入文件,支持断点断续(下载速度不如正常模式,适用于小说章节较多的情况)

$ bs -t [小说名]

默认并发数为 64,若要修改并发限制

$ bs --limit [number] [小说名]
$ bs -l [number] [小说名]

运行效果

❗ tips

如果需要自定义暂不支持命令行参数的设置,请 clone 本仓库操作


npm i

npm run start [小说名]

# 添加参数请使用
npm run start -s [url] [小说名]
...

以下部分为可自定义内容:

下载的小说默认在 download 文件夹下,也可以自己在 config.ts 配置

章节获取失败重试次数默认 3 次,可在 config.ts 配置

保证良好的网络可减少章节缺失率

如何配置来源网站

按照如下格式修改 config.ts 中的 source 数组,无需关心书源顺序

具体可以参考已配置的网站

{
    Url: "", // 网站的根路径
    Selector: { // Selector 中的字段为 css 选择器
      SEARCH_RESULT: "", // 搜索页面的结果 a 标签
      BOOK_NAME: "", // 书籍名称
      BOOK_AUTHOR: "", // 书籍作者
      BOOK_DES: "", // 书籍介绍
      CONTENT_URLS: "", // 目录章节链接
      CONTENT_TITLE: "", // 章节标题
      BOOK_CONTENT: "", // 章节内容
    },
    AD: [], // 广告
    Query: {
      path: "", // 查询书籍的 url
      param: "", // 查询书籍的参数
    },
  }