@lightcone-ai/daemon 0.15.16 → 0.15.17
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.
|
@@ -53,6 +53,8 @@ export class KuaishouAdapter {
|
|
|
53
53
|
if (!redirectUrl.includes('cp.kuaishou.com/article/publish')) {
|
|
54
54
|
throw new Error(`LOGIN_EXPIRED: 快手登录已过期,请重新扫码连接 (redirected to: ${redirectUrl})`);
|
|
55
55
|
}
|
|
56
|
+
await this._clickByText('放弃');
|
|
57
|
+
await sleep(500);
|
|
56
58
|
try { await this._cdp.send('Runtime.evaluate', { expression: 'window.scrollTo(0, 300)', returnByValue: false }); } catch {}
|
|
57
59
|
await this._waitForSelector('input[type="file"], [class*="upload"], [class*="Upload"]', 45000);
|
|
58
60
|
|
|
@@ -89,6 +91,10 @@ export class KuaishouAdapter {
|
|
|
89
91
|
if (!redirectUrl.includes('cp.kuaishou.com/article/publish')) {
|
|
90
92
|
throw new Error(`LOGIN_EXPIRED: 快手登录已过期,请重新扫码连接 (redirected to: ${redirectUrl})`);
|
|
91
93
|
}
|
|
94
|
+
// Dismiss "continue previous draft?" dialog if present (appears when session is reused)
|
|
95
|
+
await this._clickByText('放弃');
|
|
96
|
+
await sleep(500);
|
|
97
|
+
|
|
92
98
|
// Scroll once to trigger any lazy-rendered upload widgets, then wait
|
|
93
99
|
try { await this._cdp.send('Runtime.evaluate', { expression: 'window.scrollTo(0, 300)', returnByValue: false }); } catch {}
|
|
94
100
|
await this._waitForSelector('input[type="file"], [class*="upload"], [class*="Upload"]', 45000);
|
|
@@ -97,8 +103,8 @@ export class KuaishouAdapter {
|
|
|
97
103
|
if (!loggedIn) throw new Error('LOGIN_EXPIRED: 快手登录已过期,请重新扫码连接');
|
|
98
104
|
|
|
99
105
|
await this._uploadFiles([video], 'video');
|
|
100
|
-
// Wait for publish form:
|
|
101
|
-
await this._waitForSelector('[placeholder*="描述"], [contenteditable="true"]', 120000);
|
|
106
|
+
// Wait for publish form: description field appears after upload; id=work-description-edit is reliable
|
|
107
|
+
await this._waitForSelector('#work-description-edit, [placeholder*="描述"], [contenteditable="true"]', 120000);
|
|
102
108
|
|
|
103
109
|
// Kuaishou video publish has no dedicated title input; skip if field not found
|
|
104
110
|
if (title) {
|
|
@@ -106,7 +112,7 @@ export class KuaishouAdapter {
|
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
const fullText = formatTextWithTags(text, tags);
|
|
109
|
-
await this._fillField('[placeholder*="描述"], [contenteditable]', fullText);
|
|
115
|
+
await this._fillField('#work-description-edit, [placeholder*="描述"], [contenteditable]', fullText);
|
|
110
116
|
|
|
111
117
|
await sleep(1000);
|
|
112
118
|
await this._clickByText('发布');
|
|
@@ -176,7 +182,9 @@ export class KuaishouAdapter {
|
|
|
176
182
|
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
177
183
|
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
178
184
|
} else {
|
|
179
|
-
|
|
185
|
+
// contenteditable (React/Vue): execCommand keeps framework state in sync
|
|
186
|
+
document.execCommand('selectAll', false);
|
|
187
|
+
document.execCommand('insertText', false, ${JSON.stringify(value)});
|
|
180
188
|
el.dispatchEvent(new InputEvent('input', { bubbles: true }));
|
|
181
189
|
}
|
|
182
190
|
return true;
|