From 42d39f2693f4936a7f14df97164aa2193a02608b Mon Sep 17 00:00:00 2001 From: DerekEXS Date: Tue, 16 Jun 2026 20:12:58 +0800 Subject: [PATCH] chore(xiaohongshu): switch default channel to chromium Same reason as the ks uploader: bundled patchright cannot reliably resolve the system 'chrome' channel on every platform, so use the bundled 'chromium' channel by default and rely on conf.py:LOCAL_CHROME_PATH for users who want real Chrome. --- uploader/xiaohongshu_uploader/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uploader/xiaohongshu_uploader/main.py b/uploader/xiaohongshu_uploader/main.py index 0a51076..a94d53c 100644 --- a/uploader/xiaohongshu_uploader/main.py +++ b/uploader/xiaohongshu_uploader/main.py @@ -153,7 +153,7 @@ async def cookie_auth(account_file): if LOCAL_CHROME_PATH: browser = await playwright.chromium.launch(headless=True, executable_path=LOCAL_CHROME_PATH) else: - browser = await playwright.chromium.launch(headless=True, channel="chrome") + browser = await playwright.chromium.launch(headless=True, channel="chromium") try: context = await browser.new_context(storage_state=account_file) context = await set_init_script(context) @@ -220,7 +220,7 @@ async def xiaohongshu_cookie_gen( account_path.parent.mkdir(parents=True, exist_ok=True) async with async_playwright() as playwright: - browser = await playwright.chromium.launch(headless=headless, channel="chrome") + browser = await playwright.chromium.launch(headless=headless, channel="chromium") context = await browser.new_context() context = await set_init_script(context) qrcode_path = None @@ -603,7 +603,7 @@ class XiaoHongShuVideo(XiaoHongShuBaseUploader): xiaohongshu_logger.info(_msg("🧍", "小人先检查 cookie、视频文件、封面和发布时间")) await self.validate_upload_args() xiaohongshu_logger.info(_msg("🥳", "上传前检查通过")) - browser = await playwright.chromium.launch(headless=self.headless, channel="chrome") + browser = await playwright.chromium.launch(headless=self.headless, channel="chromium") context = await browser.new_context( permissions=["geolocation"], storage_state=self.account_file, @@ -723,7 +723,7 @@ class XiaoHongShuNote(XiaoHongShuBaseUploader): xiaohongshu_logger.info(_msg("🧍", "小人先检查 cookie、图片和发布时间")) await self.validate_upload_args() xiaohongshu_logger.info(_msg("🥳", "图文上传前检查通过")) - browser = await playwright.chromium.launch(headless=self.headless, channel="chrome") + browser = await playwright.chromium.launch(headless=self.headless, channel="chromium") context = await browser.new_context( permissions=["geolocation"], storage_state=self.account_file,