nonebot-plugin-htmlrender 0.6.6__tar.gz → 0.6.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/PKG-INFO +1 -1
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/browser.py +3 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/config.py +4 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/data_source.py +3 -2
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/pyproject.toml +1 -1
- nonebot_plugin_htmlrender-0.6.7/uv.lock +1926 -0
- nonebot_plugin_htmlrender-0.6.6/uv.lock +0 -1828
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.dockerignore +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.github/workflows/codecov.yml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.github/workflows/docker_image.yml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.github/workflows/publish.yml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.gitignore +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.pre-commit-config.yaml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.python-version +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/LICENSE +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/README.md +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docker-compose.yaml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/dockerfile +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/example.md +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/html2pic.png +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/md2pic.png +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/template2pic.png +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/text2pic.png +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/entrypoint.sh +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/docker-compose.yaml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/entrypoint.sh +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/__init__.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/html2pic.html +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/markdown.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/mystyle.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/progress.html.jinja2 +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/text.html +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/utils.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/pyproject.toml +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/__init__.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/consts.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/install.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/process.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/signal.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/github-markdown-light.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/katex.min.b64_fonts.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/katex.min.js +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/mathtex-script-type.min.js +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/mhchem.min.js +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/markdown.html +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/pygments-default.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/text.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/text.html +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/utils.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/__init__.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/conftest.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/resources/test_template_filter.png +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/markdown.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/mystyle.css +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/progress.html.jinja2 +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/text.html +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_browser.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_deprecated_decorator.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_htmlrender.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_install.py +0 -0
- {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_process.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nonebot-plugin-htmlrender
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.7
|
|
4
4
|
Summary: 通过浏览器渲染图片
|
|
5
5
|
Project-URL: Homepage, https://github.com/kexue-z/nonebot-plugin-htmlrender
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/kexue-z/nonebot-plugin-htmlrender/issues
|
|
@@ -169,6 +169,9 @@ async def start_browser(**kwargs) -> Browser:
|
|
|
169
169
|
if plugin_config.htmlrender_proxy_host:
|
|
170
170
|
kwargs["proxy"] = proxy_settings(plugin_config.htmlrender_proxy_host)
|
|
171
171
|
|
|
172
|
+
if plugin_config.htmlrender_browser_args:
|
|
173
|
+
kwargs["args"] = plugin_config.htmlrender_browser_args.split()
|
|
174
|
+
|
|
172
175
|
if plugin_config.htmlrender_browser_executable_path:
|
|
173
176
|
kwargs["executable_path"] = plugin_config.htmlrender_browser_executable_path
|
|
174
177
|
else:
|
|
@@ -39,6 +39,10 @@ class Config(BaseModel):
|
|
|
39
39
|
default=None, description="通过Playwright协议连接Playwright浏览器的端点地址。"
|
|
40
40
|
)
|
|
41
41
|
|
|
42
|
+
htmlrender_browser_args: Optional[str] = Field(
|
|
43
|
+
default=None, description="Playwright 浏览器启动参数。"
|
|
44
|
+
)
|
|
45
|
+
|
|
42
46
|
@model_validator(mode="after")
|
|
43
47
|
@classmethod
|
|
44
48
|
def check_browser_channel(cls, data: Any) -> Any:
|
|
@@ -141,7 +141,7 @@ async def md_to_pic(
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
async def read_file(path: str) -> str:
|
|
144
|
-
async with aiofiles.open(path) as f:
|
|
144
|
+
async with aiofiles.open(path, encoding="UTF8") as f:
|
|
145
145
|
return await f.read()
|
|
146
146
|
|
|
147
147
|
|
|
@@ -189,6 +189,7 @@ async def html_to_pic(
|
|
|
189
189
|
quality: Union[int, None] = None,
|
|
190
190
|
device_scale_factor: float = 2,
|
|
191
191
|
screenshot_timeout: Optional[float] = 30_000,
|
|
192
|
+
full_page: Optional[bool] = True,
|
|
192
193
|
**kwargs,
|
|
193
194
|
) -> bytes:
|
|
194
195
|
"""html转图片
|
|
@@ -215,7 +216,7 @@ async def html_to_pic(
|
|
|
215
216
|
await page.set_content(html, wait_until="networkidle")
|
|
216
217
|
await page.wait_for_timeout(wait)
|
|
217
218
|
return await page.screenshot(
|
|
218
|
-
full_page=
|
|
219
|
+
full_page=full_page,
|
|
219
220
|
type=type,
|
|
220
221
|
quality=quality,
|
|
221
222
|
timeout=screenshot_timeout,
|