|
|
@@ -1332,6 +1332,32 @@ export class DouyinAdapter extends BasePlatformAdapter {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 填写描述/简介
|
|
|
+ if (params.description) {
|
|
|
+ logger.info('[Douyin Publish] Filling description...');
|
|
|
+ const descSelectors = [
|
|
|
+ '[class*="editor"] [contenteditable="true"]',
|
|
|
+ '.notranslate',
|
|
|
+ 'textarea[placeholder*="描述"]',
|
|
|
+ 'textarea[placeholder*="简介"]',
|
|
|
+ ];
|
|
|
+ let descFilled = false;
|
|
|
+ for (const selector of descSelectors) {
|
|
|
+ const descInput = this.page.locator(selector).first();
|
|
|
+ if (await descInput.count() > 0 && await descInput.isVisible().catch(() => false)) {
|
|
|
+ await descInput.click();
|
|
|
+ await this.page.waitForTimeout(300);
|
|
|
+ await this.page.keyboard.type(params.description, { delay: 30 });
|
|
|
+ descFilled = true;
|
|
|
+ logger.info(`[Douyin Publish] Description filled via: ${selector}`);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!descFilled) {
|
|
|
+ logger.warn('[Douyin Publish] Could not find description input');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
onProgress?.(60, '正在添加话题标签...');
|
|
|
|
|
|
// 参考 matrix: 添加话题标签
|