Преглед на файлове

fix #6168: include video description in auto-publish

Douyin and Weixin adapters' Playwright fallback publish paths were
missing the description filling step. After filling the title, they
jumped directly to tags without entering the video description.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ethanfly преди 3 дни
родител
ревизия
7231c8101c
променени са 2 файла, в които са добавени 33 реда и са изтрити 1 реда
  1. 26 0
      server/src/automation/platforms/douyin.ts
  2. 7 1
      server/src/automation/platforms/weixin.ts

+ 26 - 0
server/src/automation/platforms/douyin.ts

@@ -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: 添加话题标签

+ 7 - 1
server/src/automation/platforms/weixin.ts

@@ -863,12 +863,18 @@ export class WeixinAdapter extends BasePlatformAdapter {
 
       onProgress?.(60, '正在填写视频信息...');
 
-      // 填写标题和话题
+      // 填写标题、描述和话题
       const editorDiv = this.page.locator('div.input-editor, [contenteditable="true"]').first();
       if (await editorDiv.count() > 0) {
         await editorDiv.click();
         await this.page.keyboard.type(params.title);
 
+        // 填写描述
+        if (params.description) {
+          await this.page.keyboard.press('Enter');
+          await this.page.keyboard.type(params.description);
+        }
+
         if (params.tags && params.tags.length > 0) {
           await this.page.keyboard.press('Enter');
           for (const tag of params.tags) {