From 327ed18ba29519d0748662c76ea077889a8a1682 Mon Sep 17 00:00:00 2001 From: Leo Song Date: Wed, 15 Oct 2025 16:50:58 +0800 Subject: [PATCH] bug fixes --- sau_backend.py | 3 ++- uploader/douyin_uploader/main.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sau_backend.py b/sau_backend.py index 397f343..a74e026 100644 --- a/sau_backend.py +++ b/sau_backend.py @@ -336,6 +336,7 @@ def postVideo(): if category == 0: category = None productLink = data.get('productLink', '') + productTitle = data.get('productTitle', '') videos_per_day = data.get('videosPerDay') daily_times = data.get('dailyTimes') @@ -352,7 +353,7 @@ def postVideo(): start_days) case 3: post_video_DouYin(title, file_list, tags, account_list, category, enableTimer, videos_per_day, daily_times, - start_days) + start_days, productLink, productTitle) case 4: post_video_ks(title, file_list, tags, account_list, category, enableTimer, videos_per_day, daily_times, start_days) diff --git a/uploader/douyin_uploader/main.py b/uploader/douyin_uploader/main.py index 32fb1b7..8d3b59d 100644 --- a/uploader/douyin_uploader/main.py +++ b/uploader/douyin_uploader/main.py @@ -160,8 +160,10 @@ class DouYinVideo(object): douyin_logger.info(f'总共添加{len(self.tags)}个话题') if self.productLink and self.productTitle: + douyin_logger.info(f' [-] 正在设置商品链接...') await asyncio.sleep(1) await self.set_product_link(page, self.productLink, self.productTitle) + douyin_logger.info(f' [+] 完成设置商品链接...') while True: # 判断重新上传按钮是否存在,如果不存在,代表视频正在上传,则等待 @@ -186,7 +188,7 @@ class DouYinVideo(object): await self.set_thumbnail(page, self.thumbnail_path) # 更换可见元素 - await self.set_location(page, "杭州市") + await self.set_location(page, "") # 頭條/西瓜 third_part_element = '[class^="info"] > [class^="first-part"] div div.semi-switch' @@ -237,7 +239,9 @@ class DouYinVideo(object): # await finish_confirm_element.click() # await page.locator("div[class^='footer'] button:has-text('完成')").click() - async def set_location(self, page: Page, location: str = "杭州市"): + async def set_location(self, page: Page, location: str = ""): + if not location: + return # todo supoort location later # await page.get_by_text('添加标签').locator("..").locator("..").locator("xpath=following-sibling::div").locator( # "div.semi-select-single").nth(0).click()