fix: wkhtmltoimage兼容UA参数

This commit is contained in:
2025-12-31 19:13:20 +08:00
parent 7cf39f80bc
commit 7c3d0a0947

View File

@@ -80,10 +80,11 @@ def take_screenshot_wkhtmltoimage(
"--enable-local-file-access",
"--encoding",
"utf-8",
"--user-agent",
_WKHTMLTOIMAGE_UA,
]
if _WKHTMLTOIMAGE_UA:
cmd.extend(["--custom-header", "User-Agent", _WKHTMLTOIMAGE_UA, "--custom-header-propagation"])
if image_format in ("jpg", "jpeg"):
cmd.extend(["--quality", str(_WKHTMLTOIMAGE_QUALITY)])