mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-25 07:36:27 +00:00
🎨 Update timeout config of Hyperion
client
This commit is contained in:
parent
9a1b9271e7
commit
8814979cef
@ -25,8 +25,8 @@ class Hyperion:
|
|||||||
"Chrome/90.0.4430.72 Safari/537.36"
|
"Chrome/90.0.4430.72 Safari/537.36"
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
self.client = HyperionRequest(headers=self.get_headers())
|
self.client = HyperionRequest(headers=self.get_headers(), *args, **kwargs)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def extract_post_id(text: str) -> int:
|
def extract_post_id(text: str) -> int:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from typing import List, Optional, Tuple, TYPE_CHECKING, Union
|
from typing import List, Optional, Tuple, TYPE_CHECKING, Union
|
||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
from httpx import Timeout
|
||||||
from telegram import (
|
from telegram import (
|
||||||
InlineKeyboardButton,
|
InlineKeyboardButton,
|
||||||
InlineKeyboardMarkup,
|
InlineKeyboardMarkup,
|
||||||
@ -47,7 +48,14 @@ class Post(Plugin.Conversation):
|
|||||||
MENU_KEYBOARD = ReplyKeyboardMarkup([["推送频道", "添加TAG"], ["编辑文字", "删除图片"], ["退出"]], True, True)
|
MENU_KEYBOARD = ReplyKeyboardMarkup([["推送频道", "添加TAG"], ["编辑文字", "删除图片"], ["退出"]], True, True)
|
||||||
|
|
||||||
def __init__(self):
|
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] = []
|
self.last_post_id_list: List[int] = []
|
||||||
|
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user