Skip to content

Commit 52d0703

Browse files
committed
v1.9.11
- 支持环境变量配置DOH域名和DNS服务器 - 问题修复
1 parent 23fe643 commit 52d0703

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

app/chain/download.py

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def post_download_message(self, meta: MetaBase, mediainfo: MediaInfo, torrent: T
7676
msg_text = f"{msg_text}\n促销:{torrent.volume_factor}"
7777
if torrent.hit_and_run:
7878
msg_text = f"{msg_text}\nHit&Run:是"
79+
if torrent.labels:
80+
msg_text = f"{msg_text}\n标签:{' '.join(torrent.labels)}"
7981
if torrent.description:
8082
html_re = re.compile(r'<[^>]+>', re.S)
8183
description = html_re.sub('', torrent.description)

app/core/config.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class Settings(BaseSettings):
225225
# Github token,提高请求api限流阈值 ghp_****
226226
GITHUB_TOKEN: Optional[str] = None
227227
# 指定的仓库Github token,多个仓库使用,分隔,格式:{user1}/{repo1}:ghp_****,{user2}/{repo2}:github_pat_****
228-
GITHUB_TOKEN_FOR_REPO: Optional[str] = None
228+
REPO_GITHUB_TOKEN: Optional[str] = None
229229
# Github代理服务器,格式:https://mirror.ghproxy.com/
230230
GITHUB_PROXY: Optional[str] = ''
231231
# 自动检查和更新站点资源包(站点索引、认证等)
@@ -364,18 +364,18 @@ def GITHUB_HEADERS(self):
364364
}
365365
return {}
366366

367-
def GITHUB_HEADERS_FOR_REPO(self, repo: str = None):
367+
def REPO_GITHUB_HEADERS(self, repo: str = None):
368368
"""
369369
Github指定的仓库请求头
370370
:param repo: 指定的仓库名称,格式为 "user/repo"。如果为空,或者没有找到指定仓库请求头,则返回默认的请求头信息
371371
:return: Github请求头
372372
"""
373373
# 如果没有传入指定的仓库名称,或没有配置指定的仓库Token,则返回默认的请求头信息
374-
if not repo or not self.GITHUB_TOKEN_FOR_REPO:
374+
if not repo or not self.REPO_GITHUB_TOKEN:
375375
return self.GITHUB_HEADERS
376376
headers = {}
377377
# 格式:{user1}/{repo1}:ghp_****,{user2}/{repo2}:github_pat_****
378-
token_pairs = self.GITHUB_TOKEN_FOR_REPO.split(",")
378+
token_pairs = self.REPO_GITHUB_TOKEN.split(",")
379379
for token_pair in token_pairs:
380380
try:
381381
parts = token_pair.split(":")

app/helper/plugin.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_plugins(self, repo_url: str) -> Dict[str, dict]:
5252
return {}
5353
raw_url = self._base_url % (user, repo)
5454
res = RequestUtils(proxies=self.proxies,
55-
headers=settings.GITHUB_HEADERS_FOR_REPO(repo=f"{user}/{repo}"),
55+
headers=settings.REPO_GITHUB_HEADERS(repo=f"{user}/{repo}"),
5656
timeout=10).get_res(f"{raw_url}package.json")
5757
if res:
5858
try:
@@ -146,7 +146,7 @@ def __get_filelist(_p: str) -> Tuple[Optional[list], Optional[str]]:
146146
"""
147147
file_api = f"https://api.github.com/repos/{user_repo}/contents/plugins/{_p}"
148148
r = RequestUtils(proxies=settings.PROXY,
149-
headers=settings.GITHUB_HEADERS_FOR_REPO(repo=user_repo),
149+
headers=settings.REPO_GITHUB_HEADERS(repo=user_repo),
150150
timeout=30).get_res(file_api)
151151
if r is None:
152152
return None, "连接仓库失败"
@@ -169,7 +169,7 @@ def __download_files(_p: str, _l: List[dict]) -> Tuple[bool, str]:
169169
download_url = f"{settings.GITHUB_PROXY}{item.get('download_url')}"
170170
# 下载插件文件
171171
res = RequestUtils(proxies=self.proxies,
172-
headers=settings.GITHUB_HEADERS_FOR_REPO(repo=user_repo),
172+
headers=settings.REPO_GITHUB_HEADERS(repo=user_repo),
173173
timeout=60).get_res(download_url)
174174
if not res:
175175
return False, f"文件 {item.get('name')} 下载失败!"

version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
APP_VERSION = 'v1.9.10-1'
1+
APP_VERSION = 'v1.9.11'

0 commit comments

Comments
 (0)