diff --git a/modules/apihelper/client/components/hyperion.py b/modules/apihelper/client/components/hyperion.py index ccecc00..0fff33a 100644 --- a/modules/apihelper/client/components/hyperion.py +++ b/modules/apihelper/client/components/hyperion.py @@ -25,8 +25,8 @@ class Hyperion: "Chrome/90.0.4430.72 Safari/537.36" ) - def __init__(self): - self.client = HyperionRequest(headers=self.get_headers()) + def __init__(self, *args, **kwargs): + self.client = HyperionRequest(headers=self.get_headers(), *args, **kwargs) @staticmethod def extract_post_id(text: str) -> int: diff --git a/plugins/admin/post.py b/plugins/admin/post.py index dab424a..6960054 100644 --- a/plugins/admin/post.py +++ b/plugins/admin/post.py @@ -1,6 +1,7 @@ from typing import List, Optional, Tuple, TYPE_CHECKING, Union from bs4 import BeautifulSoup +from httpx import Timeout from telegram import ( InlineKeyboardButton, InlineKeyboardMarkup, @@ -47,7 +48,14 @@ class Post(Plugin.Conversation): MENU_KEYBOARD = ReplyKeyboardMarkup([["推送频道", "添加TAG"], ["编辑文字", "删除图片"], ["退出"]], True, True) def __init__(self): - self.bbs = Hyperion() + self.bbs = Hyperion( + timeout=Timeout( + connect=config.connect_timeout, + read=config.read_timeout, + write=config.write_timeout, + pool=config.pool_timeout, + ) + ) self.last_post_id_list: List[int] = [] async def initialize(self):