Repository navigation
Expand file tree
/
Copy pathconfig.example.toml
More file actions
81 lines (73 loc) · 2.69 KB
/
Copy pathconfig.example.toml
File metadata and controls
81 lines (73 loc) · 2.69 KB
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
# 配置模板:复制为 config.toml 后编辑(config.toml 不进 git)
# 带 xxx 的地方都需要按实际情况修改
[settings]
# 网盘客户端的同步目录。爬虫下载到这里,客户端负责自动上传。
# 个人电脑上改成真实同步目录,例如 "D:/BaiduSync/学习资料"
sync_dir = "./data/sync"
# 去重状态库位置
db_path = "./data/state.db"
# 对同一站点的请求间隔秒数(别调太小,对站点礼貌一点)
request_delay = 2.0
# watch 模式轮询间隔(分钟)
watch_interval_min = 30
# HTTP 超时(秒)
timeout = 20
# ---------- hunt 关键词找站 ----------
[hunt]
# 网盘搜索引擎(主力,返回分享链接直接进索引): pansearch / qupansou
# 注: qupansou 接口 2026-10 观测不稳定(证书问题),要加回自己加
# 通用引擎(兜底,探测打分,video候选走引擎收割): bing / baidu / ddg
engines = ["pansearch", "bing"]
# watch 模式每轮读取的关键词文件(一行一个关键词,# 注释;新关键词自动 hunt 一次)
keywords_file = "./keywords.txt"
# 采集时立即校验链接死活(约 2 秒/条)
check_links = true
# 只收可校验的链接(百度/夸克/蓝奏),阿里等无法判死活的直接丢弃
checkable_only = true
# 每次最多探测的站点数
max_sites = 10
# 每站最多直接下载的文件数(防失控)
max_files_per_site = 5
# 探测时跳过这些域名(登录墙/无文件可抓的站)
blocklist = [
"zhihu.com", "weibo.com", "tieba.baidu.com",
"douyin.com", "baijiahao.baidu.com",
]
# 自定义搜索源(可选):url 里 {query} 换成关键词、{page} 换成页码
# [[hunt.engine]]
# name = "我的搜索站"
# url = "https://example.com/search?q={query}&p={page}"
# item = "div.result"
# link = "a"
# title = "a"
# ---------- 来源示例(四类各一个,全部 enabled=false,改好再开) ----------
[[source]]
name = "示例-论坛"
type = "forum"
url = "https://example.com/list"
category = "电子书" # 同步目录下的子文件夹名
enabled = false
follow_detail = true # 进入帖子详情页找附件
max_items = 30
[source.selectors] # 打开列表页 F12 看结构后填写
item = "div.post" # 每个条目的容器
title = "h3 a" # 标题(相对条目,可省略)
link = "h3 a" # 链接(相对条目,必填)
[[source]]
name = "示例-链接站"
type = "linkhub"
url = "https://example.com/pan"
category = "_links"
enabled = false
[[source]]
name = "示例-图包"
type = "gallery"
url = "https://example.com/album/123"
category = "图包"
enabled = false
[[source]]
name = "示例-课程"
type = "video"
url = "https://example.com/course/1"
category = "课程"
enabled = false