INNER CODE UNIT · Python

handle_upload_error

toki-plus/video-mover · Upload/uploader/ks_uploader/main.py:74

    async def handle_upload_error(self, page):
        kuaishou_logger.error("视频出错了,重新上传中")
        await page.locator('div.progress-div [class^="upload-btn-input"]').set_input_files(self.file_path)

    async def upload(self, playwright: Playwright) -> None:
        # 使用 Chromium 浏览器启动一个浏览器实例
        print(self.local_executable_path)
        if self.local_executable_path:
            browser = await playwright.chromium.launch(
                headless=False,
                executable_path=self.local_executable_path,
            )
        else:
            browser = await playwright.chromium.launch(
                headless=False
            )  # 创建一个浏览器上下文,使用指定的 cookie 文件
        context = await browser.new_context(storage_state=f"{self.account_file}")
        context = await set_init_script(context)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…