From 83803ddb7374ad1acc6f75cf82f196c38b689d69 Mon Sep 17 00:00:00 2001 From: Asankilp Date: Mon, 2 Dec 2024 13:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dssl=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E4=B8=8D=E4=BD=BF=E7=94=A8https=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/deal_latex.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nonebot_plugin_marshoai/deal_latex.py b/nonebot_plugin_marshoai/deal_latex.py index 88d963ca..e66e2e90 100644 --- a/nonebot_plugin_marshoai/deal_latex.py +++ b/nonebot_plugin_marshoai/deal_latex.py @@ -15,6 +15,7 @@ See the Mulan PSL v2 for more details. """ from typing import Optional, Literal, Tuple +from nonebot import logger import httpx import time @@ -39,7 +40,7 @@ class ConvertChannel: class L2PChannel(ConvertChannel): - URL = "https://www.latex2png.com" + URL = "http://www.latex2png.com" async def get_to_convert( self, @@ -94,9 +95,9 @@ class L2PChannel(ConvertChannel): start_time = time.time_ns() latex2png = ( client.get( - "https://www.latex2png.com{}" + "http://www.latex2png.com{}" + client.post( - "https://www.latex2png.com/api/convert", + "http://www.latex2png.com/api/convert", json={ "auth": {"user": "guest", "password": "guest"}, "latex": "\\\\int_{a}^{b} x^2 \\\\, dx = \\\\frac{b^3}{3} - \\\\frac{a^3}{5}\n", @@ -228,7 +229,7 @@ class JRTChannel(ConvertChannel): joeraut = ( client.get( client.post( - "https://www.latex2png.com/api/convert", + "http://www.latex2png.com/api/convert", json={ "latexInput": "\\\\int_{a}^{b} x^2 \\\\, dx = \\\\frac{b^3}{3} - \\\\frac{a^3}{5}", "outputFormat": "PNG", @@ -256,6 +257,7 @@ class ConvertLatex: def __init__(self, channel: Optional[ConvertChannel] = None) -> None: if channel is None: + logger.info("正在选择 LaTeX 转换服务频道,请稍等...") self.channel = self.auto_choose_channel() else: self.channel = channel