wangzhibo
2025-07-30 25087cbe79c8c4992551477d55d9db8bbea2202e
auto_media_publisher/uploaders/login_chrome.py
@@ -40,9 +40,9 @@
                browser_args["proxy"] = {"server": self.proxy}
            self.browser = await playwright.chromium.launch(**browser_args)
            if os.path.exists(self.cookie_path):
                self.context = await self.browser.new_context(storage_state=f"{self.cookie_path}", user_agent=DEFAULT_USER_AGENT)
                self.context = await self.browser.new_context(storage_state=f"{self.cookie_path}", user_agent=DEFAULT_USER_AGENT,viewport={"width": 1920, "height": 1080})
            else:
                self.context = await self.browser.new_context(user_agent=DEFAULT_USER_AGENT)
                self.context = await self.browser.new_context(user_agent=DEFAULT_USER_AGENT,viewport={"width": 1920, "height": 1080})
            if os.path.exists(PLAYWRIGHT_STEALTH_JS_PATH):
                await self.context.add_init_script(path=Path(PLAYWRIGHT_STEALTH_JS_PATH))
            await self.context.grant_permissions(['geolocation'])