mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-29 11:03:16 +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
|
proxy_url: Optional[AnyUrl] = None
|
||||||
"""代理链接"""
|
"""代理链接"""
|
||||||
|
upload_bbs_host: Optional[AnyUrl] = "https://upload-bbs.miyoushe.com"
|
||||||
|
|
||||||
bot_token: str = ""
|
bot_token: str = ""
|
||||||
"""BOT的token"""
|
"""BOT的token"""
|
||||||
|
@ -3,6 +3,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
from core.config import config
|
||||||
from ..base.hyperionrequest import HyperionRequest
|
from ..base.hyperionrequest import HyperionRequest
|
||||||
from ...models.genshin.hyperion import PostInfo, ArtworkImage
|
from ...models.genshin.hyperion import PostInfo, ArtworkImage
|
||||||
from ...typedefs import JSON_DATA
|
from ...typedefs import JSON_DATA
|
||||||
@ -122,6 +123,7 @@ class Hyperion:
|
|||||||
filename = os.path.basename(url)
|
filename = os.path.basename(url)
|
||||||
_, file_extension = os.path.splitext(filename)
|
_, file_extension = os.path.splitext(filename)
|
||||||
is_image = bool(file_extension in ".jpg" or file_extension in ".png")
|
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(
|
response = await self.client.get(
|
||||||
url, params=self.get_images_params(resize=2000) if is_image else None, de_json=False
|
url, params=self.get_images_params(resize=2000) if is_image else None, de_json=False
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user