crawl_config.json
5.82 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
{
"name": "publisher_content_upload",
"description": "内容上传技能爬取配置 - 模拟CMS发布系统接口规范",
"version": "1.0.0",
"created": "2026-03-27T10:00:00Z",
"dataSources": [
{
"id": "cms_api_spec",
"type": "api_spec",
"name": "CMS内容上传接口规范",
"description": "模拟内容发布系统的REST API接口规范",
"endpoint": "/api/v1/contents",
"method": "POST",
"auth": "Bearer token",
"contentType": "application/json",
"rateLimit": {
"requestsPerSecond": 5,
"burst": 10
},
"retry": {
"maxAttempts": 3,
"backoffMs": 1000
}
},
{
"id": "metadata_api",
"type": "api_spec",
"name": "元数据接口",
"description": "获取/更新内容元数据",
"endpoint": "/api/v1/contents/{contentId}/metadata",
"method": "GET/PUT",
"auth": "Bearer token",
"rateLimit": {
"requestsPerSecond": 10,
"burst": 20
}
},
{
"id": "validation_api",
"type": "api_spec",
"name": "内容验证接口",
"description": "预校验内容是否符合发布要求",
"endpoint": "/api/v1/contents/validate",
"method": "POST",
"auth": "Bearer token",
"rateLimit": {
"requestsPerSecond": 20,
"burst": 50
}
},
{
"id": "publish_status_api",
"type": "api_spec",
"name": "发布状态查询接口",
"description": "查询内容发布状态",
"endpoint": "/api/v1/contents/{contentId}/status",
"method": "GET",
"auth": "Bearer token",
"rateLimit": {
"requestsPerSecond": 10,
"burst": 20
}
}
],
"requestSchema": {
"type": "object",
"required": ["title", "content", "metadata"],
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "剧本标题"
},
"content": {
"type": "string",
"minLength": 100,
"maxLength": 50000,
"description": "剧本正文"
},
"metadata": {
"type": "object",
"required": ["category", "author"],
"properties": {
"category": {
"type": "string",
"enum": ["剧情", "喜剧", "爱情", "悬疑", "科幻", "动作", "动画"],
"description": "剧本分类"
},
"tags": {
"type": "array",
"items": {"type": "string"},
"maxItems": 5,
"description": "标签列表"
},
"author": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "作者名称"
},
"copyright": {
"type": "string",
"maxLength": 200,
"description": "版权声明"
},
"wordCount": {
"type": "integer",
"minimum": 0,
"maximum": 100000,
"description": "字数统计"
}
}
},
"publishTime": {
"type": "string",
"format": "date-time",
"description": "定时发布时间"
},
"status": {
"type": "string",
"enum": ["draft", "pending", "published"],
"default": "draft",
"description": "内容状态"
}
}
},
"responseSchema": {
"success": {
"201": {
"description": "创建成功",
"schema": {
"type": "object",
"properties": {
"success": {"type": "boolean"},
"data": {
"type": "object",
"properties": {
"contentId": {"type": "string"},
"status": {"type": "string"},
"publishedAt": {"type": "string", "format": "date-time"},
"url": {"type": "string", "format": "uri"}
}
}
}
}
},
"200": {
"description": "更新成功",
"schema": {
"type": "object",
"properties": {
"success": {"type": "boolean"},
"data": {"type": "object"}
}
}
}
},
"error": {
"400": {
"description": "请求格式错误",
"schema": {
"type": "object",
"properties": {
"success": {"type": "boolean", "const": false},
"error": {
"type": "object",
"properties": {
"code": {"type": "string"},
"message": {"type": "string"},
"details": {"type": "array"}
}
}
}
}
},
"401": {
"description": "认证失败"
},
"403": {
"description": "权限不足"
},
"422": {
"description": "验证失败"
},
"429": {
"description": "请求过于频繁"
},
"500": {
"description": "服务器内部错误"
},
"502": {
"description": "网关错误"
},
"503": {
"description": "服务不可用"
},
"504": {
"description": "超时"
}
}
},
"errorHandling": {
"retryableCodes": [429, 500, 502, 503, 504],
"nonRetryableCodes": [400, 401, 403, 404, 422],
"exponentialBackoff": {
"initialDelayMs": 1000,
"maxDelayMs": 30000,
"multiplier": 2
},
"circuitBreaker": {
"failureThreshold": 5,
"resetTimeoutMs": 60000
}
},
"headers": {
"default": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"auth": {
"Authorization": "Bearer {token}"
}
},
"crawlRules": {
"respectRobotsTxt": true,
"requestDelayMs": 2000,
"timeoutMs": 30000,
"maxRedirects": 3,
"userAgent": "Publisher-Skill/1.0"
}
}