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.
This commit is contained in:
DerekEXS
2026-06-16 20:12:58 +08:00
parent dff5a3d7ea
commit 42d39f2693
+4 -4
View File
@@ -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,