oc-browser-relay 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-relay/index.js +44 -3
- package/bundled-relay/public/configs/pages/guanghe-taobao-publish.json +271 -0
- package/bundled-relay/public/configs/pages/index.json +4 -1
- package/bundled-relay/public/configs/pages/kuaishou-creator-publish.json +279 -0
- package/bundled-relay/public/configs/pages/taobao-item-detail.json +32 -0
- package/bundled-relay/public/configs/pages/wechat-channels-publish.json +291 -0
- package/bundled-relay/public/configs/sites/guanghe-taobao.json +42 -0
- package/bundled-relay/public/configs/sites/index.json +4 -1
- package/bundled-relay/public/configs/sites/kuaishou-creator.json +49 -0
- package/bundled-relay/public/configs/sites/wechat-channels.json +30 -0
- package/bundled-relay/public/configs/task-templates/guanghe-taobao-publish-video.json +133 -0
- package/bundled-relay/public/configs/task-templates/index.json +7 -1
- package/bundled-relay/public/configs/task-templates/kuaishou-creator-publish-video.json +114 -0
- package/bundled-relay/public/configs/task-templates/kuaishou-creator-save-draft.json +114 -0
- package/bundled-relay/public/configs/task-templates/taobao-item-detail-images.json +78 -0
- package/bundled-relay/public/configs/task-templates/wechat-channels-publish-video.json +144 -0
- package/bundled-relay/public/configs/task-templates/wechat-channels-save-draft.json +152 -0
- package/index.js +52 -37
- package/package.json +1 -1
- package/skills/oc-browser-relay-article/SKILL.md +31 -15
- package/skills/oc-browser-relay-guanghe-taobao/SKILL.md +62 -0
- package/skills/oc-browser-relay-kuaishou/SKILL.md +65 -0
- package/skills/oc-browser-relay-taobao/SKILL.md +29 -4
- package/skills/oc-browser-relay-wechat-channels/SKILL.md +75 -0
package/bundled-relay/index.js
CHANGED
|
@@ -23208,7 +23208,11 @@ var TemplateExecutor = class _TemplateExecutor {
|
|
|
23208
23208
|
}
|
|
23209
23209
|
}
|
|
23210
23210
|
mergeXiaohongshuTopicsIntoContent(template, data) {
|
|
23211
|
-
|
|
23211
|
+
const isXiaohongshu = template.platform === "xiaohongshu" && ["publish_note", "save_note_draft"].includes(template.taskType);
|
|
23212
|
+
const isWechatChannels = template.platform === "wechat" && ["publish_video", "save_video_draft"].includes(template.taskType);
|
|
23213
|
+
const isKuaishou = template.platform === "kuaishou" && ["publish_video", "save_video_draft"].includes(template.taskType);
|
|
23214
|
+
const isGuangheTaobao = template.platform === "taobao" && template.taskType === "publish_video" && template.siteId === "guanghe_taobao";
|
|
23215
|
+
if (!isXiaohongshu && !isWechatChannels && !isKuaishou && !isGuangheTaobao) {
|
|
23212
23216
|
return data;
|
|
23213
23217
|
}
|
|
23214
23218
|
if (!Array.isArray(data.topics) || data.topics.length === 0 || typeof data.content !== "string") {
|
|
@@ -23223,7 +23227,7 @@ var TemplateExecutor = class _TemplateExecutor {
|
|
|
23223
23227
|
const mergedContent = existingContent.includes(topicLine) ? existingContent : `${existingContent}
|
|
23224
23228
|
|
|
23225
23229
|
${topicLine}`;
|
|
23226
|
-
console.log("[TemplateExecutor] \u5408\u5E76\
|
|
23230
|
+
console.log("[TemplateExecutor] \u5408\u5E76\u8BDD\u9898\u5230\u6B63\u6587", {
|
|
23227
23231
|
siteId: template.siteId,
|
|
23228
23232
|
taskType: template.taskType,
|
|
23229
23233
|
topicCount: normalizedTopics.length,
|
|
@@ -24121,10 +24125,47 @@ function resolveTargetAskAnswerCount(value) {
|
|
|
24121
24125
|
return Math.floor(parsed);
|
|
24122
24126
|
}
|
|
24123
24127
|
|
|
24128
|
+
// processors/taobao/detail-images.ts
|
|
24129
|
+
function asArray3(value) {
|
|
24130
|
+
return Array.isArray(value) ? value : [];
|
|
24131
|
+
}
|
|
24132
|
+
function asRecord3(value) {
|
|
24133
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
24134
|
+
}
|
|
24135
|
+
function normalizeImageUrl(url) {
|
|
24136
|
+
if (typeof url !== "string" || !url.trim()) return null;
|
|
24137
|
+
const trimmed = url.trim();
|
|
24138
|
+
if (trimmed.startsWith("//")) return "https:" + trimmed;
|
|
24139
|
+
return trimmed;
|
|
24140
|
+
}
|
|
24141
|
+
var processTaobaoDetailImages = async (input) => {
|
|
24142
|
+
const pages = asArray3(input.sources?.detail_images_capture);
|
|
24143
|
+
const firstPage = asRecord3(pages[0]);
|
|
24144
|
+
const body = asRecord3(firstPage) ?? {};
|
|
24145
|
+
const data = asRecord3(body.data) ?? {};
|
|
24146
|
+
const components = asRecord3(data.components) ?? {};
|
|
24147
|
+
const layout = asArray3(components.layout);
|
|
24148
|
+
const componentData = asRecord3(components.componentData) ?? {};
|
|
24149
|
+
const imageUrls = layout.map((item) => {
|
|
24150
|
+
const id = item?.ID;
|
|
24151
|
+
if (!id) return null;
|
|
24152
|
+
const comp = asRecord3(componentData[id]);
|
|
24153
|
+
const model = asRecord3(comp?.model);
|
|
24154
|
+
return normalizeImageUrl(model?.picUrl);
|
|
24155
|
+
}).filter((url) => url !== null);
|
|
24156
|
+
if (imageUrls.length > 0 && /-tps-\d/.test(imageUrls[imageUrls.length - 1])) {
|
|
24157
|
+
imageUrls.pop();
|
|
24158
|
+
}
|
|
24159
|
+
return {
|
|
24160
|
+
data: { imageUrls, count: imageUrls.length }
|
|
24161
|
+
};
|
|
24162
|
+
};
|
|
24163
|
+
|
|
24124
24164
|
// processors/registry.ts
|
|
24125
24165
|
var PROCESSORS = {
|
|
24126
24166
|
"taobao.comments": processTaobaoComments,
|
|
24127
|
-
"taobao.ask_answers": processTaobaoAskAnswers
|
|
24167
|
+
"taobao.ask_answers": processTaobaoAskAnswers,
|
|
24168
|
+
"taobao.detail_images": processTaobaoDetailImages
|
|
24128
24169
|
};
|
|
24129
24170
|
function resolveStructuredDataProcessor(processorId) {
|
|
24130
24171
|
return PROCESSORS[processorId] ?? null;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pageId": "guanghe_taobao_publish",
|
|
3
|
+
"pageName": "淘宝光合视频发布页",
|
|
4
|
+
"platform": "taobao",
|
|
5
|
+
"siteId": "guanghe_taobao",
|
|
6
|
+
"pageType": "publish_form",
|
|
7
|
+
"version": "1.0.0",
|
|
8
|
+
"urlMatch": [
|
|
9
|
+
"https://creator.guanghe.taobao.com/page/pubNew/video*"
|
|
10
|
+
],
|
|
11
|
+
"iframe": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"urlPattern": "huodong.taobao.com"
|
|
14
|
+
},
|
|
15
|
+
"readiness": {
|
|
16
|
+
"loginRequired": true,
|
|
17
|
+
"loginPagePatterns": [
|
|
18
|
+
"https://login.taobao.com/*"
|
|
19
|
+
],
|
|
20
|
+
"loginWaitTimeoutMs": 120000,
|
|
21
|
+
"pageReadyWhen": {
|
|
22
|
+
"type": "logical_or",
|
|
23
|
+
"conditions": [
|
|
24
|
+
{
|
|
25
|
+
"type": "element_visible",
|
|
26
|
+
"selector": ".creator-add-video-v2-border"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "element_visible",
|
|
30
|
+
"selector": "#creator-add-video-v2-upload-btn"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"publishFormSignals": {
|
|
35
|
+
"uploadInputLocators": [
|
|
36
|
+
{
|
|
37
|
+
"kind": "css",
|
|
38
|
+
"value": "input[type='file'][accept*='.mp4']",
|
|
39
|
+
"priority": 1
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"visibleLocators": [
|
|
43
|
+
{
|
|
44
|
+
"kind": "css",
|
|
45
|
+
"value": "#creator-add-video-v2-upload-btn",
|
|
46
|
+
"priority": 1
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"kind": "css",
|
|
50
|
+
"value": ".creator-add-video-v2-border",
|
|
51
|
+
"priority": 2
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"kind": "text",
|
|
55
|
+
"value": "上传视频",
|
|
56
|
+
"priority": 3
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"waitTimeoutMs": 15000
|
|
61
|
+
},
|
|
62
|
+
"reusePolicy": {
|
|
63
|
+
"enabled": false
|
|
64
|
+
},
|
|
65
|
+
"fields": {
|
|
66
|
+
"video": {
|
|
67
|
+
"fieldId": "video",
|
|
68
|
+
"label": "视频上传",
|
|
69
|
+
"type": "file_upload",
|
|
70
|
+
"required": true,
|
|
71
|
+
"locators": [
|
|
72
|
+
{
|
|
73
|
+
"kind": "css",
|
|
74
|
+
"value": "input[type='file'][accept*='.mp4']",
|
|
75
|
+
"priority": 1
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"kind": "css",
|
|
79
|
+
"value": ".next-upload-inner input[type='file']",
|
|
80
|
+
"priority": 2
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"inputStrategy": {
|
|
84
|
+
"mode": "file_upload",
|
|
85
|
+
"waitForUploadComplete": true,
|
|
86
|
+
"uploadCompleteTimeoutMs": 300000,
|
|
87
|
+
"useBlobInjection": true
|
|
88
|
+
},
|
|
89
|
+
"validation": {
|
|
90
|
+
"maxCount": 1,
|
|
91
|
+
"acceptTypes": [
|
|
92
|
+
"video/mp4",
|
|
93
|
+
"video/quicktime",
|
|
94
|
+
"video/x-flv",
|
|
95
|
+
"video/x-m4v",
|
|
96
|
+
"video/avi",
|
|
97
|
+
"video/x-ms-wmv",
|
|
98
|
+
"video/mpeg",
|
|
99
|
+
"video/3gpp",
|
|
100
|
+
"video/x-matroska"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"observationRules": {
|
|
104
|
+
"filledWhen": "thumbnail_count_gt_0",
|
|
105
|
+
"emptyWhen": "thumbnail_count_eq_0",
|
|
106
|
+
"countSelectors": [
|
|
107
|
+
"[class*='publish-guanghe__video-show--container']",
|
|
108
|
+
"[class*='video-show--previewInfoContainer']"
|
|
109
|
+
],
|
|
110
|
+
"uploadingSelectors": [],
|
|
111
|
+
"successLocators": [
|
|
112
|
+
"[class*='publish-guanghe__video-show--container']"
|
|
113
|
+
],
|
|
114
|
+
"successSettleDelayMs": 500
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"title": {
|
|
118
|
+
"fieldId": "title",
|
|
119
|
+
"label": "标题",
|
|
120
|
+
"type": "text",
|
|
121
|
+
"required": false,
|
|
122
|
+
"locators": [
|
|
123
|
+
{
|
|
124
|
+
"kind": "css",
|
|
125
|
+
"value": "input[placeholder*='加个标题']",
|
|
126
|
+
"priority": 1
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"kind": "css",
|
|
130
|
+
"value": ".short-title-form input[type='text']",
|
|
131
|
+
"priority": 2
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"kind": "css",
|
|
135
|
+
"value": "input[placeholder*='标题']",
|
|
136
|
+
"priority": 3
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"inputStrategy": {
|
|
140
|
+
"mode": "human_typing",
|
|
141
|
+
"clearBeforeInput": true,
|
|
142
|
+
"focusBeforeInput": true,
|
|
143
|
+
"blurAfterInput": true,
|
|
144
|
+
"commitMode": "blur"
|
|
145
|
+
},
|
|
146
|
+
"validation": {
|
|
147
|
+
"maxLength": 30
|
|
148
|
+
},
|
|
149
|
+
"observationRules": {
|
|
150
|
+
"filledWhen": "value_non_empty",
|
|
151
|
+
"emptyWhen": "value_empty"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"content": {
|
|
155
|
+
"fieldId": "content",
|
|
156
|
+
"label": "描述",
|
|
157
|
+
"type": "rich_text",
|
|
158
|
+
"required": false,
|
|
159
|
+
"locators": [
|
|
160
|
+
{
|
|
161
|
+
"kind": "css",
|
|
162
|
+
"value": "div.rich-text-content[data-cangjie-content='true']",
|
|
163
|
+
"priority": 1
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"kind": "css",
|
|
167
|
+
"value": "div[data-cangjie-content='true']",
|
|
168
|
+
"priority": 2
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"kind": "css",
|
|
172
|
+
"value": ".richText-container .rich-text-content",
|
|
173
|
+
"priority": 3
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"inputStrategy": {
|
|
177
|
+
"mode": "rich_text_input",
|
|
178
|
+
"focusBeforeInput": true,
|
|
179
|
+
"clearBeforeInput": true,
|
|
180
|
+
"typingMode": "human",
|
|
181
|
+
"commitMode": "none",
|
|
182
|
+
"hashtagCommit": {
|
|
183
|
+
"enabled": true,
|
|
184
|
+
"delayMs": 1000,
|
|
185
|
+
"commitChar": " "
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"validation": {
|
|
189
|
+
"maxLength": 1000
|
|
190
|
+
},
|
|
191
|
+
"observationRules": {
|
|
192
|
+
"filledWhen": "text_length_gt_0",
|
|
193
|
+
"emptyWhen": "text_length_eq_0"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"actions": {
|
|
198
|
+
"publish": {
|
|
199
|
+
"actionId": "publish",
|
|
200
|
+
"label": "立即发布",
|
|
201
|
+
"kind": "submit",
|
|
202
|
+
"locators": [
|
|
203
|
+
{
|
|
204
|
+
"kind": "xpath",
|
|
205
|
+
"value": "//button[contains(@class,'next-btn-primary')][.//span[contains(normalize-space(),'立即发布')]]",
|
|
206
|
+
"priority": 1
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"kind": "css",
|
|
210
|
+
"value": "#container-right button.next-btn-primary",
|
|
211
|
+
"priority": 2
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"kind": "text",
|
|
215
|
+
"value": "立即发布",
|
|
216
|
+
"priority": 3
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"observationRules": {
|
|
220
|
+
"type": "logical_or",
|
|
221
|
+
"conditions": [
|
|
222
|
+
{
|
|
223
|
+
"type": "url_contains",
|
|
224
|
+
"value": "/page/workspace/tb"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"type": "toast_contains",
|
|
228
|
+
"value": "内容发布成功"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"submittingTexts": [
|
|
232
|
+
"发布中",
|
|
233
|
+
"提交中",
|
|
234
|
+
"处理中"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"executionPolicy": {
|
|
240
|
+
"popupGuard": {
|
|
241
|
+
"enabled": false
|
|
242
|
+
},
|
|
243
|
+
"typingPolicy": {
|
|
244
|
+
"mode": "human_typing",
|
|
245
|
+
"minKeyDelayMs": 120,
|
|
246
|
+
"maxKeyDelayMs": 260,
|
|
247
|
+
"chunkTyping": true,
|
|
248
|
+
"chunkSizeRange": [3, 12],
|
|
249
|
+
"chunkPauseMsRange": [140, 300]
|
|
250
|
+
},
|
|
251
|
+
"clickPolicy": {
|
|
252
|
+
"scrollIntoView": true,
|
|
253
|
+
"requireVisible": true,
|
|
254
|
+
"preHover": true,
|
|
255
|
+
"hoverDurationMsRange": [80, 240],
|
|
256
|
+
"preClickPauseMsRange": [50, 140]
|
|
257
|
+
},
|
|
258
|
+
"humanBehavior": {
|
|
259
|
+
"cursorMoveSpeedRange": [110, 180],
|
|
260
|
+
"cursorStepDelayMsRange": [3, 7],
|
|
261
|
+
"cursorVisibleDurationMsRange": [120, 220],
|
|
262
|
+
"minCursorStepCount": 9,
|
|
263
|
+
"mouseDownUpDelayMsRange": [30, 80],
|
|
264
|
+
"postClickPauseMsRange": [40, 120]
|
|
265
|
+
},
|
|
266
|
+
"actionPausePolicy": {
|
|
267
|
+
"minPauseMs": 140,
|
|
268
|
+
"maxPauseMs": 700
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"douyin-creator-publish.json",
|
|
10
10
|
"douyin-fxg-homepage.json",
|
|
11
11
|
"pinduoduo-mms-home.json",
|
|
12
|
-
"pinduoduo-mms-orders-list.json"
|
|
12
|
+
"pinduoduo-mms-orders-list.json",
|
|
13
|
+
"wechat-channels-publish.json",
|
|
14
|
+
"kuaishou-creator-publish.json",
|
|
15
|
+
"guanghe-taobao-publish.json"
|
|
13
16
|
]
|
|
14
17
|
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pageId": "kuaishou_creator_publish",
|
|
3
|
+
"pageName": "快手视频发布页",
|
|
4
|
+
"platform": "kuaishou",
|
|
5
|
+
"siteId": "kuaishou_creator",
|
|
6
|
+
"pageType": "publish_form",
|
|
7
|
+
"version": "1.0.0",
|
|
8
|
+
"urlMatch": [
|
|
9
|
+
"https://cp.kuaishou.com/article/publish/video*"
|
|
10
|
+
],
|
|
11
|
+
"readiness": {
|
|
12
|
+
"loginRequired": true,
|
|
13
|
+
"loginPagePatterns": [
|
|
14
|
+
"https://cp.kuaishou.com/login*"
|
|
15
|
+
],
|
|
16
|
+
"loginWaitTimeoutMs": 120000,
|
|
17
|
+
"pageReadyWhen": {
|
|
18
|
+
"type": "logical_or",
|
|
19
|
+
"conditions": [
|
|
20
|
+
{
|
|
21
|
+
"type": "element_visible",
|
|
22
|
+
"selector": "input[type='file'][accept*='video']"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "element_visible",
|
|
26
|
+
"selector": "button[class*='upload-btn']"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"publishFormSignals": {
|
|
31
|
+
"uploadInputLocators": [
|
|
32
|
+
{
|
|
33
|
+
"kind": "css",
|
|
34
|
+
"value": "input[type='file'][accept*='video']",
|
|
35
|
+
"priority": 1
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"visibleLocators": [
|
|
39
|
+
{
|
|
40
|
+
"kind": "css",
|
|
41
|
+
"value": "button[class*='upload-btn']",
|
|
42
|
+
"priority": 1
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"kind": "text",
|
|
46
|
+
"value": "上传视频",
|
|
47
|
+
"priority": 2
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"waitTimeoutMs": 15000
|
|
52
|
+
},
|
|
53
|
+
"reusePolicy": {
|
|
54
|
+
"enabled": true,
|
|
55
|
+
"taskTypes": [
|
|
56
|
+
"publish_video",
|
|
57
|
+
"save_video_draft"
|
|
58
|
+
],
|
|
59
|
+
"candidatePages": [
|
|
60
|
+
"kuaishou_creator_publish"
|
|
61
|
+
],
|
|
62
|
+
"requiredFields": [
|
|
63
|
+
"video"
|
|
64
|
+
],
|
|
65
|
+
"requiredActions": [
|
|
66
|
+
"publish"
|
|
67
|
+
],
|
|
68
|
+
"recoverMode": "publish_ready"
|
|
69
|
+
},
|
|
70
|
+
"fields": {
|
|
71
|
+
"video": {
|
|
72
|
+
"fieldId": "video",
|
|
73
|
+
"label": "视频上传",
|
|
74
|
+
"type": "file_upload",
|
|
75
|
+
"required": true,
|
|
76
|
+
"locators": [
|
|
77
|
+
{
|
|
78
|
+
"kind": "css",
|
|
79
|
+
"value": "input[type='file'][accept*='video']",
|
|
80
|
+
"priority": 1
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"kind": "css",
|
|
84
|
+
"value": "input[type='file']",
|
|
85
|
+
"priority": 2
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"inputStrategy": {
|
|
89
|
+
"mode": "file_upload",
|
|
90
|
+
"waitForUploadComplete": false,
|
|
91
|
+
"useBlobInjection": true
|
|
92
|
+
},
|
|
93
|
+
"validation": {
|
|
94
|
+
"maxCount": 1,
|
|
95
|
+
"acceptTypes": [
|
|
96
|
+
"video/mp4",
|
|
97
|
+
"video/quicktime",
|
|
98
|
+
"video/x-flv",
|
|
99
|
+
"video/x-m4v",
|
|
100
|
+
"video/webm",
|
|
101
|
+
"video/x-matroska",
|
|
102
|
+
"video/avi",
|
|
103
|
+
"video/x-ms-wmv",
|
|
104
|
+
"video/mpeg",
|
|
105
|
+
"video/3gpp"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"observationRules": {
|
|
109
|
+
"filledWhen": "thumbnail_count_gt_0",
|
|
110
|
+
"emptyWhen": "thumbnail_count_eq_0"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"content": {
|
|
114
|
+
"fieldId": "content",
|
|
115
|
+
"label": "作品描述",
|
|
116
|
+
"type": "rich_text",
|
|
117
|
+
"required": false,
|
|
118
|
+
"locators": [
|
|
119
|
+
{
|
|
120
|
+
"kind": "css",
|
|
121
|
+
"value": "#work-description-edit[contenteditable='true']",
|
|
122
|
+
"priority": 1
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"kind": "css",
|
|
126
|
+
"value": "[class*='description'][contenteditable='true']",
|
|
127
|
+
"priority": 2
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"inputStrategy": {
|
|
131
|
+
"mode": "rich_text_input",
|
|
132
|
+
"focusBeforeInput": true,
|
|
133
|
+
"clearBeforeInput": true,
|
|
134
|
+
"typingMode": "human",
|
|
135
|
+
"commitMode": "none",
|
|
136
|
+
"hashtagCommit": {
|
|
137
|
+
"enabled": true,
|
|
138
|
+
"delayMs": 1000,
|
|
139
|
+
"commitChar": " "
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"validation": {
|
|
143
|
+
"maxLength": 500
|
|
144
|
+
},
|
|
145
|
+
"observationRules": {
|
|
146
|
+
"filledWhen": "text_length_gt_0",
|
|
147
|
+
"emptyWhen": "text_length_eq_0"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"actions": {
|
|
152
|
+
"publish": {
|
|
153
|
+
"actionId": "publish",
|
|
154
|
+
"label": "发布",
|
|
155
|
+
"kind": "submit",
|
|
156
|
+
"locators": [
|
|
157
|
+
{
|
|
158
|
+
"kind": "xpath",
|
|
159
|
+
"value": "//div[contains(@class,'edit-section-btns')]//div[contains(@class,'button-primary')]",
|
|
160
|
+
"priority": 1
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"kind": "xpath",
|
|
164
|
+
"value": "//*[@id='joyride-wrapper']/main/div[2]/div[2]/div[1]/div[6]/div[1]",
|
|
165
|
+
"priority": 2
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"observationRules": {
|
|
169
|
+
"type": "logical_or",
|
|
170
|
+
"conditions": [
|
|
171
|
+
{
|
|
172
|
+
"type": "url_contains",
|
|
173
|
+
"value": "/article/manage/video"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"type": "url_contains",
|
|
177
|
+
"value": "status=2"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"type": "text_visible",
|
|
181
|
+
"value": "发布完毕"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"type": "text_visible",
|
|
185
|
+
"value": "内容发布成功"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"submittingTexts": [
|
|
189
|
+
"发布中",
|
|
190
|
+
"提交中"
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"saveDraft": {
|
|
195
|
+
"actionId": "saveDraft",
|
|
196
|
+
"label": "取消(存草稿)",
|
|
197
|
+
"kind": "save",
|
|
198
|
+
"locators": [
|
|
199
|
+
{
|
|
200
|
+
"kind": "xpath",
|
|
201
|
+
"value": "//div[contains(@class,'edit-section-btns')]//div[contains(@class,'button-default')]",
|
|
202
|
+
"priority": 1
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"observationRules": {
|
|
206
|
+
"type": "logical_or",
|
|
207
|
+
"conditions": [
|
|
208
|
+
{
|
|
209
|
+
"type": "url_contains",
|
|
210
|
+
"value": "/article/manage/video"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "text_visible",
|
|
214
|
+
"value": "发布完毕"
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"executionPolicy": {
|
|
221
|
+
"popupGuard": {
|
|
222
|
+
"enabled": false
|
|
223
|
+
},
|
|
224
|
+
"typingPolicy": {
|
|
225
|
+
"mode": "human_typing",
|
|
226
|
+
"minKeyDelayMs": 100,
|
|
227
|
+
"maxKeyDelayMs": 250,
|
|
228
|
+
"chunkTyping": true,
|
|
229
|
+
"chunkSizeRange": [
|
|
230
|
+
3,
|
|
231
|
+
10
|
|
232
|
+
],
|
|
233
|
+
"chunkPauseMsRange": [
|
|
234
|
+
120,
|
|
235
|
+
260
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"clickPolicy": {
|
|
239
|
+
"scrollIntoView": true,
|
|
240
|
+
"requireVisible": true,
|
|
241
|
+
"preHover": true,
|
|
242
|
+
"hoverDurationMsRange": [
|
|
243
|
+
100,
|
|
244
|
+
400
|
|
245
|
+
],
|
|
246
|
+
"preClickPauseMsRange": [
|
|
247
|
+
80,
|
|
248
|
+
250
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
"humanBehavior": {
|
|
252
|
+
"cursorMoveSpeedRange": [
|
|
253
|
+
110,
|
|
254
|
+
180
|
|
255
|
+
],
|
|
256
|
+
"cursorStepDelayMsRange": [
|
|
257
|
+
4,
|
|
258
|
+
12
|
|
259
|
+
],
|
|
260
|
+
"cursorVisibleDurationMsRange": [
|
|
261
|
+
180,
|
|
262
|
+
320
|
|
263
|
+
],
|
|
264
|
+
"minCursorStepCount": 12,
|
|
265
|
+
"mouseDownUpDelayMsRange": [
|
|
266
|
+
40,
|
|
267
|
+
120
|
|
268
|
+
],
|
|
269
|
+
"postClickPauseMsRange": [
|
|
270
|
+
40,
|
|
271
|
+
120
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
"actionPausePolicy": {
|
|
275
|
+
"minPauseMs": 140,
|
|
276
|
+
"maxPauseMs": 700
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
@@ -125,6 +125,17 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"captureSources": {
|
|
128
|
+
"detail_images": {
|
|
129
|
+
"urlPattern": "/h5/mtop.taobao.detail.getdesc/",
|
|
130
|
+
"method": "GET",
|
|
131
|
+
"capability": "hybrid",
|
|
132
|
+
"operation": "capture_response",
|
|
133
|
+
"persistent": true,
|
|
134
|
+
"artifactType": "hybrid",
|
|
135
|
+
"includeBody": true,
|
|
136
|
+
"locationSuffix": "taobao_detail_images",
|
|
137
|
+
"hint": "capture taobao product detail images"
|
|
138
|
+
},
|
|
128
139
|
"product_comments": {
|
|
129
140
|
"urlPattern": "/h5/mtop.taobao.rate.detaillist.get/",
|
|
130
141
|
"method": "GET",
|
|
@@ -148,6 +159,14 @@
|
|
|
148
159
|
}
|
|
149
160
|
},
|
|
150
161
|
"capturePlans": {
|
|
162
|
+
"detail_images": {
|
|
163
|
+
"sourceId": "detail_images",
|
|
164
|
+
"captureNetwork": {
|
|
165
|
+
"timeoutMs": 15000,
|
|
166
|
+
"startPhase": "before_action",
|
|
167
|
+
"actionScope": "step"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
151
170
|
"product_comments": {
|
|
152
171
|
"sourceId": "product_comments",
|
|
153
172
|
"captureNetwork": {
|
|
@@ -167,6 +186,19 @@
|
|
|
167
186
|
},
|
|
168
187
|
"crawlerHints": {
|
|
169
188
|
"structuredDataExtractors": {
|
|
189
|
+
"detail_images": {
|
|
190
|
+
"processorId": "taobao.detail_images",
|
|
191
|
+
"timeoutMs": 15000,
|
|
192
|
+
"observationSources": [
|
|
193
|
+
{
|
|
194
|
+
"sourceId": "detail_images_capture",
|
|
195
|
+
"nodeIdArg": "sourceNodeId",
|
|
196
|
+
"sourceType": "active_capture_results",
|
|
197
|
+
"consumeCapture": true,
|
|
198
|
+
"resultPath": "bodyJson"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
170
202
|
"product_detail": {
|
|
171
203
|
"adapterId": "taobao_item_detail",
|
|
172
204
|
"sourceId": "product_detail",
|