Code Monkey home page Code Monkey logo

sangyuxiaowu / bookmaker Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 120 KB

BookMaker is a command-line tool designed for downloading books from specified URLs, generating directory files, downloading and merging chapters, creating a single document, and converting txt files into epub files. This tool enables users to easily create, edit, and share ebooks.BookMaker 是一款命令行工具,专为下载书籍、生成目录文件、下载并合并章节、生成单一文档,以及将 txt 文件转换为 epub

C# 98.81% Shell 1.19%
book epub epub-generation

bookmaker's Introduction

BookMaker

BookMaker 项目

BookMaker 是一个命令行工具,用于从指定 URL 下载书籍,生成目录文件,下载章节,合并章节并生成单个文档,以及将 txt 文件转换为 epub 文件。

使用

BookMaker 提供了以下命令:

list

获取指定URL书籍的目录列表,并生成目录文件。

BookMaker list -u <url> -s <selector> [-h <host>] [-o <output>]

参数说明:

  • -u, --url <url>:设置书籍URL。(必需)
  • -s, --selector <selector>:设置书籍目录选择器。(必需)
  • -h, --host <host>:设置章节前面拼接的URL,默认为空。
  • -o, --output <output>:设置保存文件名,默认为 chapters.json

down

根据目录信息下载章节。

BookMaker down -j <json> -s <selector> [-d <dir>] [-r <regex>] [-n <next>] [-w <wait>] [-b <begin>]

参数说明:

  • -j, --json <json>:设置书籍目录 json 文件,默认为 chapters.json
  • -s, --selector <selector>:设置章节内容选择器。(必需)
  • -d, --dir <dir>:设置书籍保存目录,默认为 download
  • -r, --regex <regex>:设置广告内容删除正则,默认为空。
  • -n, --next <next>:设置下一页判断选择器,默认为空。
  • -w, --wait <wait>:设置等待秒数,默认为 10。
  • -b, --begin <begin>:设置开始章节,默认为 1。

make

合并章节生成单个文档。

BookMaker make -j <json> [-d <dir>] [-f <format>] [-o <output>] [-t <title>] [-a <author>] [-i <intro>] [-c <cover>]

参数说明:

  • -j, --json <json>:设置书籍目录 json 文件,默认为 chapters.json
  • -d, --dir <dir>:设置书籍章节目录,默认为 download
  • -f, --format <format>:设置书籍类型,默认为 txt。可选值为 txtepub
  • -o, --output <output>:设置书籍保存文件名,默认为 book.txt
  • -t, --title <title>:设置书籍标题,默认为 book
  • -a, --author <author>:设置书籍作者,默认为空。
  • -i, --intro <intro>:设置书籍简介,默认为空。
  • -c, --cover <cover>:设置书籍封面,默认为空。

txt2epub

将 txt 文件转换为 epub 文件。

BookMaker txt2epub -f <file> [-r <regex>] [-d <debug>] [-o <output>] [-t <title>] [-a <author>] [-i <intro>] [-c <cover>]

参数说明:

  • -f, --file <file>:设置要转换的 txt 文件。(必需)
  • -r, --regex <regex>:设置目录提取正则,默认为空,使用内置正则。
  • -d, --debug <debug>:设置是否为测试模式,默认为 false
  • -o, --output <output>:设置书籍保存文件名,默认为 book.epub
  • -t, --title <title>:设置书籍标题,默认为 book
  • -a, --author <author>:设置书籍作者,默认为空。
  • -i, --intro <intro>:设置书籍简介,默认为空。
  • -c, --cover <cover>:设置书籍封面,默认为空。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.