修复拼写错误,但未修复Linux ssl错误

This commit is contained in:
Asankilp 2024-12-02 01:45:11 +08:00
parent f7932ec1fc
commit 4b12424221
4 changed files with 10 additions and 7 deletions

View File

@ -275,7 +275,7 @@ async def marsho(target: MsgTarget, event: Event, text: Optional[UniMsg] = None)
target_list.append([target.id, target.private]) target_list.append([target.id, target.private])
# 对话成功发送消息 # 对话成功发送消息
if config.marshoai_enable_richtext_prase: if config.marshoai_enable_richtext_parse:
await (await parse_richtext(str(choice.message.content))).send( await (await parse_richtext(str(choice.message.content))).send(
reply_to=True reply_to=True
) )
@ -333,7 +333,7 @@ async def marsho(target: MsgTarget, event: Event, text: Optional[UniMsg] = None)
context.append(choice.message.as_dict(), target.id, target.private) context.append(choice.message.as_dict(), target.id, target.private)
# 发送消息 # 发送消息
if config.marshoai_enable_richtext_prase: if config.marshoai_enable_richtext_parse:
await (await parse_richtext(str(choice.message.content))).send( await (await parse_richtext(str(choice.message.content))).send(
reply_to=True reply_to=True
) )

View File

@ -42,7 +42,7 @@ CODE_BLOCK_PATTERN = re.compile(r"```(.*?)```|`(.*?)`", re.DOTALL)
IMG_LATEX_PATTERN = re.compile( IMG_LATEX_PATTERN = re.compile(
( (
r"(!\[[^\]]*\]\([^()]*\))|(\\begin\{equation\}.*?\\end\{equation\}|\$.*?\$|\$\$.*?\$\$|\\\[.*?\\\]|\\\(.*?\\\))" r"(!\[[^\]]*\]\([^()]*\))|(\\begin\{equation\}.*?\\end\{equation\}|\$.*?\$|\$\$.*?\$\$|\\\[.*?\\\]|\\\(.*?\\\))"
if config.marshoai_single_latex_prase if config.marshoai_single_latex_parse
else r"(!\[[^\]]*\]\([^()]*\))|(\\begin\{equation\}.*?\\end\{equation\}|\$\$.*?\$\$|\\\[.*?\\\])" else r"(!\[[^\]]*\]\([^()]*\))|(\\begin\{equation\}.*?\\end\{equation\}|\$\$.*?\$\$|\\\[.*?\\\])"
), ),
re.DOTALL, re.DOTALL,

View File

@ -52,6 +52,7 @@ class L2PChannel(ConvertChannel):
async with httpx.AsyncClient( async with httpx.AsyncClient(
timeout=timeout, timeout=timeout,
verify=False,
) as client: ) as client:
while retry > 0: while retry > 0:
try: try:
@ -88,7 +89,7 @@ class L2PChannel(ConvertChannel):
@staticmethod @staticmethod
def channel_test() -> int: def channel_test() -> int:
with httpx.Client(timeout=5) as client: with httpx.Client(timeout=5,verify=False) as client:
try: try:
start_time = time.time_ns() start_time = time.time_ns()
latex2png = ( latex2png = (
@ -128,6 +129,7 @@ class CDCChannel(ConvertChannel):
) -> Tuple[Literal[True], bytes] | Tuple[Literal[False], bytes | str]: ) -> Tuple[Literal[True], bytes] | Tuple[Literal[False], bytes | str]:
async with httpx.AsyncClient( async with httpx.AsyncClient(
timeout=timeout, timeout=timeout,
verify=False,
) as client: ) as client:
while retry > 0: while retry > 0:
@ -153,7 +155,7 @@ class CDCChannel(ConvertChannel):
@staticmethod @staticmethod
def channel_test() -> int: def channel_test() -> int:
with httpx.Client(timeout=5) as client: with httpx.Client(timeout=5,verify=False) as client:
try: try:
start_time = time.time_ns() start_time = time.time_ns()
codecogs = ( codecogs = (
@ -185,6 +187,7 @@ class JRTChannel(ConvertChannel):
async with httpx.AsyncClient( async with httpx.AsyncClient(
timeout=timeout, timeout=timeout,
verify=False,
) as client: ) as client:
while retry > 0: while retry > 0:
try: try:
@ -219,7 +222,7 @@ class JRTChannel(ConvertChannel):
@staticmethod @staticmethod
def channel_test() -> int: def channel_test() -> int:
with httpx.Client(timeout=5) as client: with httpx.Client(timeout=5,verify=False) as client:
try: try:
start_time = time.time_ns() start_time = time.time_ns()
joeraut = ( joeraut = (

View File

@ -282,7 +282,7 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. See the Mulan PSL v2 for more details.
""" """
if config.marshoai_enable_richtext_prase: if config.marshoai_enable_richtext_parse:
latex_convert = ConvertLatex() # 开启一个转换实例 latex_convert = ConvertLatex() # 开启一个转换实例