Skip to content

Commit 83da9ca

Browse files
committed
update README
1 parent 3578671 commit 83da9ca

File tree

4 files changed

+83
-45
lines changed

4 files changed

+83
-45
lines changed

AD.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
- 段落最后`rs`
77
- `天才一秒记住`
88

9+
## 某些匹配问题
10+
11+
小说《一世之尊》
12+
13+
卷: "第三卷 满堂花醉三千客" 章节: "第十四章 姚家小鬼"
14+
15+
在盗版站的章节名均为`"第14章 姚家小鬼"`
16+
917
### 删去、谐音、变体
1018

1119
以下几个字被删去

README.md

Lines changed: 71 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,87 @@
44

55
**该软件所产生的文档请勿传播,请勿用于数据评估外的其他用途**
66

7-
[![License](https://img.shields.io/github/license/ma6254/FictionDown.svg)](https://raw.githubusercontent.com/ma6254/FictionDown/master/LICENSE)[![release_version](https://img.shields.io/github/release/ma6254/FictionDown.svg)](https://github.com/ma6254/FictionDown/releases)[![last-commit](https://img.shields.io/github/last-commit/ma6254/FictionDown.svg)](https://github.com/ma6254/FictionDown/commits)[![Download Count](https://img.shields.io/github/downloads/ma6254/FictionDown/total.svg)](https://github.com/ma6254/FictionDown/releases)
7+
[![License](https://img.shields.io/github/license/ma6254/FictionDown.svg)](https://raw.githubusercontent.com/ma6254/FictionDown/master/LICENSE)
8+
[![release_version](https://img.shields.io/github/release/ma6254/FictionDown.svg)](https://github.com/ma6254/FictionDown/releases)
9+
[![last-commit](https://img.shields.io/github/last-commit/ma6254/FictionDown.svg)](https://github.com/ma6254/FictionDown/commits)
10+
[![Download Count](https://img.shields.io/github/downloads/ma6254/FictionDown/total.svg)](https://github.com/ma6254/FictionDown/releases)
811

9-
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/ma6254/FictionDown/)[![QQ 群](https://img.shields.io/badge/qq%E7%BE%A4-934873832-orange.svg)](https://jq.qq.com/?_wv=1027&k=5bN0SVA)
12+
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/ma6254/FictionDown/)
13+
[![QQ 群](https://img.shields.io/badge/qq%E7%BE%A4-934873832-orange.svg)](https://jq.qq.com/?_wv=1027&k=5bN0SVA)
1014

11-
[![travis-ci](https://www.travis-ci.org/ma6254/FictionDown.svg?branch=master)](https://travis-ci.org/ma6254/FictionDown)[![Go Report Card](https://goreportcard.com/badge/github.com/ma6254/FictionDown)](https://goreportcard.com/report/github.com/ma6254/FictionDown)
15+
[![travis-ci](https://www.travis-ci.org/ma6254/FictionDown.svg?branch=master)](https://travis-ci.org/ma6254/FictionDown)
16+
[![Go Report Card](https://goreportcard.com/badge/github.com/ma6254/FictionDown)](https://goreportcard.com/report/github.com/ma6254/FictionDown)
17+
18+
## Usage
19+
20+
```bash
21+
NAME:
22+
FictionDown - https://github.com/ma6254/FictionDown
23+
24+
USAGE:
25+
[global options] command [command options] [arguments...]
26+
27+
AUTHOR:
28+
29+
30+
COMMANDS:
31+
download, d, down 下载缓存文件
32+
check, c, chk 检查缓存文件
33+
edit, e 对缓存文件进行手动修改
34+
convert, conv 转换格式输出
35+
pirate, p 检索盗版站点
36+
search, s 检索盗版站点
37+
help, h Shows a list of commands or help for one command
38+
39+
GLOBAL OPTIONS:
40+
-u value, --url value 图书链接
41+
--tu value, --turl value 资源网站链接
42+
-i value, --input value 输入缓存文件
43+
--log value log file path
44+
--driver value, -d value 请求方式,support: none,phantomjs,chromedp
45+
--help, -h show help
46+
--version, -v print the version
47+
```
48+
49+
## 安装和编译
50+
51+
程序为单执行文件,命令行 CLI 界面
52+
53+
包管理为 gomod
54+
55+
```bash
56+
go get github.com/ma6254/FictionDown/cmd/FictionDown
57+
```
58+
59+
交叉编译需要安装 gox
60+
61+
`make multiple_build`
1262

1363
## 特性
1464

1565
- 以起点为样本,多站点多线程爬取校对
16-
- 支持导出txt,以兼容大多数阅读器
17-
- 支持导出epub(还有些问题,某些阅读器无法打开)
18-
- 支持导出markdown,可以用pandoc转换成epub,附带epub的`metadata`,保留书本信息、卷结构、作者信息
66+
- 支持导出 txt,以兼容大多数阅读器
67+
- 支持导出 epub(还有些问题,某些阅读器无法打开)
68+
- 支持导出 markdown,可以用 pandoc 转换成 epub,附带 epub 的`metadata`,保留书本信息、卷结构、作者信息
1969
- 内置简单的广告过滤(现在还不完善)
20-
- 用Golang编写,安装部署方便,可选的外部依赖:PhantomJS、Chromedp
70+
- 用 Golang 编写,安装部署方便,可选的外部依赖:PhantomJS、Chromedp
2171
- 支持断点续爬,强制结束再爬会在上次结束的地方继续
2272

2373
## 使用注意
2474

25-
- 起点和盗版站的页面可能随时更改,可能会使抓取匹配失效,如果失效请提issue
26-
- 生成的EPUB文件可能过大,市面上大多数阅读器会异常卡顿或者直接崩溃
27-
- 某些过于老的书或者作者频繁修改的书,盗版站都没有收录,也就无法爬取,如能找此书可用的盗版站请提issue,并写出书名和正版站链接、盗版站链接
75+
- 起点和盗版站的页面可能随时更改,可能会使抓取匹配失效,如果失效请提 issue
76+
- 生成的 EPUB 文件可能过大,市面上大多数阅读器会异常卡顿或者直接崩溃
77+
- 某些过于老的书或者作者频繁修改的书,盗版站都没有收录,也就无法爬取,如能找此书可用的盗版站请提 issue,并写出书名和正版站链接、盗版站链接
2878

29-
## 使用流程
79+
## 工作流程
3080

3181
1. 输入起点链接
32-
2. 获取到书本信息,开始爬取每章内容,遇到vip章节放入`Example`中作为校对样本
82+
2. 获取到书本信息,开始爬取每章内容,遇到 vip 章节放入`Example`中作为校对样本
3383
3. 手动设置笔趣阁等盗版小说的对应链接,`tamp`字段
34-
4. 再次启动,开始爬取,只爬取VIP部分,并跟`Example`进行校对
35-
5. 手动编辑对应的缓存文件,手动删除广告和某些随机字符(有部分是关键字,可能会导致pandoc内存溢出或者样式错误)
36-
6. `conv -f md`生成markwown
37-
7. 用pandoc转换成epub`pandoc -o xxxx.epub xxxx.md`
84+
4. 再次启动,开始爬取,只爬取 VIP 部分,并跟`Example`进行校对
85+
5. 手动编辑对应的缓存文件,手动删除广告和某些随机字符(有部分是关键字,可能会导致 pandoc 内存溢出或者样式错误)
86+
6. `conv -f md`生成 markwown
87+
7. 用 pandoc 转换成 epub`pandoc -o xxxx.epub xxxx.md`
3888

3989
### Example
4090

@@ -86,44 +136,22 @@
86136

87137
## 未实现
88138

89-
- 爬取起点的时候带上`Cookie`,用于爬取已购买章节
139+
- 爬取正版的时候带上`Cookie`,用于爬取已购买章节
90140
- 支持 晋江文学城
91141
- 支持 纵横中文网
142+
- 支持有毒小说网
92143
- 支持刺猬猫(即“欢乐书客”)
93144
- ~~支持小说站内搜索~~
94-
- 整理main包中的面条逻辑
145+
- 整理 main 包中的面条逻辑
95146
- 整理命令行参数风格
96147
- 完善广告过滤
97148
- 简化使用步骤
98-
- 优化log输出
149+
- 优化 log 输出
99150
- 对于特殊章节,支持手动指定盗版链接或者跳过忽略
100151
- 外部加载匹配规则,让用户可以自己添加正/盗版源
101152
- 支持章节更新
102153
- 章节匹配过程优化
103154

104-
## 编译
105-
106-
包管理采用godep
107-
108-
1. `dep ensure -v`
109-
2. `make` or `make build` 当前目录下就会产生可执行文件
110-
111-
### 交叉编译
112-
113-
需要安装gox
114-
115-
`make multiple_build`
116-
117-
## 某些匹配问题
118-
119-
小说《一世之尊》
120-
121-
卷: "第三卷 满堂花醉三千客" 章节: "第十四章 姚家小鬼"
122-
123-
在盗版站的章节名均为`"第14章 姚家小鬼"`
124-
125-
126-
127155
## 支持的盗版站点
128156

129157
随机挑选了几个
@@ -134,4 +162,4 @@
134162
- www.booktxt.net
135163
- www.81new.com
136164
- www.shumil.co
137-
- www.wanbentxt.com
165+
- www.wanbentxt.com

cmd/FictionDown/convert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
var convert = cli.Command{
13-
Name: "Convert",
13+
Name: "convert",
1414
Usage: "转换格式输出",
1515
Aliases: []string{"conv"},
1616
Flags: []cli.Flag{

matching/matching_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package matching
33
import (
44
"log"
55
"testing"
6+
7+
"github.com/ma6254/FictionDown/utils"
68
)
79

810
func TestTitleAlias(t *testing.T) {
@@ -64,7 +66,7 @@ func TestTitleAlias(t *testing.T) {
6466
ret := TitleAlias(v.Src)
6567
log.Printf("alias: %#v", ret)
6668
for _, v := range v.Dst {
67-
if !StringInSlice(v, ret) {
69+
if !utils.StringInSlice(v, ret) {
6870
t.Fatalf("want %#v in %#v", v, ret)
6971
}
7072
}

0 commit comments

Comments
 (0)