mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 08:39:59 +08:00
✨ 重构插件商店,支持Gitee插件管理,更新相关逻辑和配置 (#1931)
This commit is contained in:
@@ -21,6 +21,9 @@ CACHED_API_TTL = 300
|
||||
RAW_CONTENT_FORMAT = "https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}"
|
||||
"""raw content格式"""
|
||||
|
||||
GITEE_RAW_CONTENT_FORMAT = "https://gitee.com/{owner}/{repo}/raw/main/{path}"
|
||||
"""gitee raw content格式"""
|
||||
|
||||
ARCHIVE_URL_FORMAT = "https://github.com/{owner}/{repo}/archive/refs/heads/{branch}.zip"
|
||||
"""archive url格式"""
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ from zhenxun.utils.http_utils import AsyncHttpx
|
||||
|
||||
from .const import (
|
||||
ARCHIVE_URL_FORMAT,
|
||||
GITEE_RAW_CONTENT_FORMAT,
|
||||
RAW_CONTENT_FORMAT,
|
||||
RELEASE_ASSETS_FORMAT,
|
||||
RELEASE_SOURCE_FORMAT,
|
||||
@@ -21,6 +22,7 @@ async def __get_fastest_formats(formats: dict[str, str]) -> list[str]:
|
||||
async def get_fastest_raw_formats() -> list[str]:
|
||||
"""获取最快的raw下载地址格式"""
|
||||
formats: dict[str, str] = {
|
||||
"https://gitee.com/": GITEE_RAW_CONTENT_FORMAT,
|
||||
"https://raw.githubusercontent.com/": RAW_CONTENT_FORMAT,
|
||||
"https://ghproxy.cc/": f"https://ghproxy.cc/{RAW_CONTENT_FORMAT}",
|
||||
"https://gh-proxy.com/": f"https://gh-proxy.com/{RAW_CONTENT_FORMAT}",
|
||||
|
||||
Reference in New Issue
Block a user