mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
✨ Support Change BBS OSS Host
This commit is contained in:
parent
640daf1e89
commit
9aaf5fb50f
@ -118,6 +118,7 @@ class ApplicationConfig(Settings):
|
||||
|
||||
proxy_url: Optional[AnyUrl] = None
|
||||
"""代理链接"""
|
||||
upload_bbs_host: Optional[AnyUrl] = "https://upload-bbs.miyoushe.com"
|
||||
|
||||
bot_token: str = ""
|
||||
"""BOT的token"""
|
||||
|
@ -3,6 +3,7 @@ import os
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
from core.config import config
|
||||
from ..base.hyperionrequest import HyperionRequest
|
||||
from ...models.genshin.hyperion import PostInfo, ArtworkImage
|
||||
from ...typedefs import JSON_DATA
|
||||
@ -122,6 +123,7 @@ class Hyperion:
|
||||
filename = os.path.basename(url)
|
||||
_, file_extension = os.path.splitext(filename)
|
||||
is_image = bool(file_extension in ".jpg" or file_extension in ".png")
|
||||
url = url.replace("https://upload-bbs.miyoushe.com", config.upload_bbs_host)
|
||||
response = await self.client.get(
|
||||
url, params=self.get_images_params(resize=2000) if is_image else None, de_json=False
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user