Skip to content

Commit 467f611

Browse files
committed
perf: 优化系统语言检测逻辑
1 parent 289ea69 commit 467f611

5 files changed

Lines changed: 15 additions & 14 deletions

File tree

docs/Release_Notes.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
**更新内容:**
22

3-
1. 将参数 `headers` 重构为 `impersonate`
4-
2. 移除 `从浏览器读取 Cookie` 功能
5-
3. 使用 `curl_cffi` 替代 `httpx`
6-
4. 优化链接匹配的正则表达式
7-
5. 重构项目内置请求延时机制
8-
6. 更新部分配置参数名称
9-
7. 更新项目英语翻译
10-
8. 优化项目运行提示
3+
1. 优化系统语言检测逻辑

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "KS-Downloader"
3-
version = "1.6"
3+
version = "1.7"
44
description = "快手(KuaiShou)作品视频/图片下载工具"
55
authors = [
66
{ name = "JoeanAmier", email = "yonglelolu@foxmail.com" },

source/static/internal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent.joinpath("Volume")
44
PROJECT_ROOT.mkdir(exist_ok=True)
55
VERSION_MAJOR = 1
6-
VERSION_MINOR = 6
7-
VERSION_BETA = False
6+
VERSION_MINOR = 7
7+
VERSION_BETA = True
88
__VERSION__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{'beta' if VERSION_BETA else 'stable'}"
99
PROJECT_NAME = f"KS-Downloader V{VERSION_MAJOR}.{VERSION_MINOR} {
1010
'Beta' if VERSION_BETA else 'Stable'

source/translation/translate.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
from contextlib import suppress
12
from gettext import translation
2-
from locale import getlocale
3+
from locale import getlocale, Error, setlocale, LC_ALL
34
from pathlib import Path
5+
import sys
46

5-
ROOT = Path(__file__).resolve().parent.parent.parent
7+
ROOT = (
8+
Path(sys.executable).resolve().parent
9+
if getattr(sys, "frozen", False)
10+
else Path(__file__).resolve().parent.parent.parent
11+
)
612

713

814
class TranslationManager:
@@ -27,6 +33,8 @@ def __init__(self, domain="ks", localedir=None):
2733
@staticmethod
2834
def get_language_code() -> str:
2935
# 获取当前系统的语言和区域设置
36+
with suppress(Error):
37+
setlocale(LC_ALL, "")
3038
language_code, __ = getlocale()
3139
if not language_code:
3240
return "en_US"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)