diff --git a/source/Settings.py b/source/Settings.py index b991e6c..96c8032 100644 --- a/source/Settings.py +++ b/source/Settings.py @@ -1,6 +1,7 @@ from json import dump from json import load from pathlib import Path +from platform import system __all__ = ['Settings'] @@ -16,6 +17,7 @@ class Settings: "chunk": 1024 * 1024, "max_retry": 5, } + encode = "UTF-8-SIG" if system() == "Windows" else "UTF-8" def __init__(self, root: Path): self.file = root.joinpath("./settings.json") @@ -24,14 +26,14 @@ class Settings: return self.read() if self.file.is_file() else self.create() def read(self) -> dict: - with self.file.open("r", encoding="utf-8") as f: + with self.file.open("r", encoding=self.encode) as f: return load(f) def create(self) -> dict: - with self.file.open("w", encoding="utf-8") as f: + with self.file.open("w", encoding=self.encode) as f: dump(self.default, f, indent=4) return self.default def update(self, data: dict): - with self.file.open("w", encoding="utf-8") as f: + with self.file.open("w", encoding=self.encode) as f: dump(data, f, indent=4, ensure_ascii=False) diff --git a/source/__init__.py b/source/__init__.py index 5d636d2..a58a4c8 100644 --- a/source/__init__.py +++ b/source/__init__.py @@ -14,7 +14,7 @@ from textual.widgets import Footer from textual.widgets import Header from textual.widgets import Input from textual.widgets import Label -from textual.widgets import ProgressBar +# from textual.widgets import ProgressBar from textual.widgets import RichLog from .Downloader import Download @@ -209,7 +209,7 @@ class XHSDownloader(App): return self.url = self.query_one(Input) self.log_ = self.query_one(RichLog) - self.bar = self.query_one(ProgressBar) + # self.bar = self.query_one(ProgressBar) async def action_check_update(self): self.__init_objects() diff --git a/static/QQ群聊二维码.png b/static/QQ群聊二维码.png index ff032dd..7323649 100644 Binary files a/static/QQ群聊二维码.png and b/static/QQ群聊二维码.png differ diff --git a/static/微信赞助二维码.png b/static/微信赞助二维码.png index e167484..49650be 100644 Binary files a/static/微信赞助二维码.png and b/static/微信赞助二维码.png differ diff --git a/static/支付宝赞助二维码.png b/static/支付宝赞助二维码.png index 755ec12..b8f447e 100644 Binary files a/static/支付宝赞助二维码.png and b/static/支付宝赞助二维码.png differ diff --git a/static/获取Cookie示意图.png b/static/获取Cookie示意图.png index 13888ae..ea63efa 100644 Binary files a/static/获取Cookie示意图.png and b/static/获取Cookie示意图.png differ