-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.yaml
135 lines (129 loc) · 5.49 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 抓取站点 all 全部 masiro 真白萌,esj esj,lightnovel 轻国,yuri 百合会
# 注意百合会登录有概率出验证码,all暂不包括百合会
site: 'esj'
# 白名单,填入书籍地址,轻国不支持该模式
white_list: []
# 黑名单,填入书籍地址,轻国不支持该模式
black_list: []
# 最大线程数 不要设置的过大 小心被ban 轻国和百合会强烈建议设置为1单线程执行
# 真白萌由于并发会ban号在程序中强制单线程执行
max_thread: 1
# 登录账号密码 请确保自己账号的权限充足
login_info:
esj:
username: ''
password: ''
masiro:
username: ''
password: ''
lightnovel:
username: ''
password: ''
yuri:
username: ''
password: ''
# 真白萌由于新加了cf盾,需要搭建flaresolverr绕过,例http://127.0.0.1:8191/v1
flaresolverr_url: ''
# 是否只爬取收藏页 百合会不支持该模式
get_collection: false
# 轻国收藏页爬取单本或合集 单本填1合集填2
lightnovel_collection_class: 1
# 开始页
start_page: 1
# 结束页 不建议一次抓取过多
end_page: 1
# 代理地址 不支持https代理 注意esj日轻只能挂非中日韩节点的代理
proxy_url: ''
# 轻国或真白萌花金币购买 注意剩余金币
is_purchase: false
# 花费上限,花费高于此值的帖子不花费,请根据自身账号情况修改
max_purchase: 20
# 请求超时时间 单位秒
time_out: 10
# 每次请求睡眠时间 比如设置2则每次请求前睡随机0~2秒 设置0不生效
# 真白萌由于频繁请求会报错,在程序中强制睡5秒
sleep_time: 1
# 字数小于此值且无图片的章节不生成epub章节 避免epub生成公告这种章节 设置0无限制
least_words: 300
# 大小小于此值的图片不下载 设置0无限制 单位byte
least_pic: 100000
# 是否抓取图片
get_pic: true
# 是否全局繁转简
convert_hans: true
# 是否强制更新 关闭时检测到目录下存在章节会跳过读取 开启时不论如何都会覆盖刷新
always_update: false
# txt保存目录 目录/站点/各章节.txt
txt_dir: './books/'
# 是否生成epub
generate_epub: true
# epub保存目录 目录/站点/书名.epub
epub_dir: './epub/'
# 下面的设置请谨慎更改 除非你对源码有足够的了解
# 通用请求头
headers:
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
Accept-Encoding: 'gzip, deflate, br'
Accept-Language: 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7'
User-Agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
# 地址配置
url_config:
esj:
login: 'https://www.esjzone.cc/inc/mem_login.php'
page: 'https://www.esjzone.cc/list-11/%d.html'
book: 'https://www.esjzone.cc%s'
pic: 'https://www.esjzone.cc%s'
collection: 'https://www.esjzone.cc/my/favorite/%d'
masiro:
login: 'https://masiro.me/admin/auth/login'
page: 'https://masiro.me/admin/loadMoreNovels?ori=0&page=%d'
book: 'https://masiro.me%s'
pic: 'https://masiro.me%s'
collection: 'https://masiro.me/admin/loadMoreNovels?page=%d&collection=1'
lightnovel:
login: 'https://www.lightnovel.us/proxy/api/user/login'
page: 'https://api.lightnovel.us/api/category/get-article-by-cate'
book: 'https://api.lightnovel.us/api/series/get-info'
chapter: 'https://api.lightnovel.us/api/article/get-detail'
pic: 'https://www.lightnovel.us/%s'
collection: 'https://api.lightnovel.us/api/history/get-collections'
yuri:
hash: 'https://bbs.yamibo.com/member.php?mod=logging&action=login'
login: 'https://bbs.yamibo.com/%s&frommessage&inajax=1'
page: 'https://bbs.yamibo.com/forum-55-%d.html'
book: 'https://bbs.yamibo.com/%s'
chapter: 'https://bbs.yamibo.com/forum.php?mod=viewthread&tid=%s&page=%s&authorid=%s'
pic: 'https://bbs.yamibo.com/%s'
collection: 'https://bbs.yamibo.com/forum-55-%d.html'
# xpath配置
xpath_config:
esj:
page: '//a[@class=''card-img-tiles'']/@href'
title: '//div[contains(@class,''book-detail'')]/h2/text()'
author: '//div[contains(@class,''book-detail'')]/ul/li[2]/a/text()'
tags: '//section[contains(@class,''widget-tags'')]/a/text()'
introduction: '//div[@class=''description'']//text()'
cover: '//div[contains(@class,''product-gallery'')]/a/@href'
chapter: '//div[@id=''chapterList'']//a/@href'
chapter_title: '//section[@class=''container'']//h2/text()'
content: '//div[contains(@class,''forum-content'')]/p//text()'
pic: '//div[contains(@class,''forum-content'')]//img/@src'
collection: '//h5[@class=''product-title'']/a/@href'
masiro:
page: '//div[@class=''layui-card'']/a[1]/@href'
title: '//div[@class=''novel-title'']/text()'
author: '//div[@class=''author'']/a/text()'
tags: '//div[@class=''tags'']//a/span/text()'
introduction: '//div[@class=''brief'']/text()'
cover: '//img[@class=''img img-thumbnail'']/@src'
chapter: '//ul[@class=''episode-ul'']//a/@href'
chapter_title: '//span[@class=''novel-title'']/div/text()'
content: '//div[@class=''box-body nvl-content'']//text()'
pic: '//div[@class=''box-body nvl-content'']//img/@src'
collection: '//div[@class=''layui-card'']/a[1]/@href'
yuri:
page: '//table[@summary=''forum_55'']/tbody/tr/th/a[2]/@href'
title: '//span[@id=''thread_subject'']/text()'
chapter: '//div[@class=''1919810'']'
author: '//dl[@class=''pil cl'']//a/text()'
collection: '//table[@summary=''forum_55'']/tbody/tr/th/a[2]/@href'