wangzhibo
2025-07-30 25087cbe79c8c4992551477d55d9db8bbea2202e
auto_media_publisher/uploaders/uploader_kuaishou.py
@@ -12,7 +12,7 @@
    async def set_schedule_time(self, page):
        try:
            self.logger.info("{self.user}, {self.platform} click schedule time......")
            publish_date_hour = self.publish_datetime.strftime("%Y-%m-%d %H:%M:%S")
            scheduled_date_hour = self.scheduled_time.strftime("%Y-%m-%d %H:%M:%S")
            await page.locator("label:text('发布时间')").locator('xpath=following-sibling::div').locator(
                '.ant-radio-input').nth(1).click()
            await asyncio.sleep(1)
@@ -21,7 +21,7 @@
            await asyncio.sleep(1)
            await page.keyboard.press("Control+KeyA")
            await page.keyboard.type(str(publish_date_hour))
            await page.keyboard.type(str(scheduled_date_hour))
            await page.keyboard.press("Enter")
            await asyncio.sleep(1)
        except Exception as e:
@@ -35,7 +35,7 @@
            async with page.expect_file_chooser() as fc_info:
                await upload_button.click()
            file_chooser = await fc_info.value
            await file_chooser.set_files(self.path_video)
            await file_chooser.set_files(self.path_media)
            await asyncio.sleep(3)
            # 等待按钮可交互
@@ -96,7 +96,7 @@
            # 2、 设置标题和描述
            await self.set_title_and_description(page)
            # 定时任务
            if self.publish_datetime != 0:
            if self.scheduled_time != 0:
                await self.set_schedule_time(page)
            # 判断视频是否发布成功
@@ -126,7 +126,7 @@
          
            return True
        except Exception as e:
            self.logger.error(f"{self.user} upload video {self.path_video} fails, error is :{e}")
            self.logger.error(f"{self.user} upload video {self.path_media} fails, error is :{e}")
            return False