Skip to content

Commit

Permalink
Merge pull request #42 from dreammis/cli
Browse files Browse the repository at this point in the history
fix douyin upload
  • Loading branch information
dreammis authored Aug 7, 2024
2 parents a242ebd + ee5e920 commit 707c467
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions douyin_uploader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, title, file_path, tags, publish_date: datetime, account_file)

async def set_schedule_time_douyin(self, page, publish_date):
# 选择包含特定文本内容的 label 元素
label_element = page.locator("label.radio--4Gpx6:has-text('定时发布')")
label_element = page.locator("[class^='radio']:has-text('定时发布')")
# 在选中的 label 元素下点击 checkbox
await label_element.click()
await asyncio.sleep(1)
Expand Down Expand Up @@ -105,7 +105,7 @@ async def upload(self, playwright: Playwright) -> None:
douyin_logger.info(f'[-] 正在打开主页...')
await page.wait_for_url("https://creator.douyin.com/creator-micro/content/upload")
# 点击 "上传视频" 按钮
await page.locator(".upload-btn--9eZLd").set_input_files(self.file_path)
await page.locator("[name='upload-btn']").set_input_files(self.file_path)

# 等待页面跳转到指定的 URL
while True:
Expand Down

0 comments on commit 707c467

Please sign in to comment.