From 213ea8234c7dbe52819f19b4e428b857fb2c93ef Mon Sep 17 00:00:00 2001 From: ThebestkillerTBK <2593828650@qq.com> Date: Tue, 5 Apr 2022 22:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-zh.md | 4 +++- README.md | 4 +++- bili-signature.py | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README-zh.md b/README-zh.md index 11f3266..f1f94f6 100644 --- a/README-zh.md +++ b/README-zh.md @@ -14,7 +14,9 @@ ## 🚀使用方法 -运行 ``python bili-signature.py`` +首先**把 ``config.json.template`` 重命名为 ``config.json``.** + +然后运行 ``python bili-signature.py``! ## ⚙配置文件 diff --git a/README.md b/README.md index 67f68e8..9c20b92 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,9 @@ This program changes your Bilibili signature depending on your account fans data ## 🚀Usage -Run ``python bili-signature.py`` +First, **rename ``config.json.template`` to ``config.json``.** + +Then, Run ``python bili-signature.py``! ## ⚙Configuration diff --git a/bili-signature.py b/bili-signature.py index 9f52861..1a9ab5e 100644 --- a/bili-signature.py +++ b/bili-signature.py @@ -62,7 +62,7 @@ def setSignature(self): return requests.post(url=self.setSignatureUrl, params=self.params, headers=self.headers, timeout=10) #配置文件管理 -class config(object): +class Config(object): #初始化配置 def initConfig(self): try: @@ -71,7 +71,7 @@ def initConfig(self): fp.close() return data except Exception: - print('文件读取失败') + print('配置读取失败,请确保你已将config.json.template重命名为config.json') exit() def __init__(self): @@ -154,7 +154,7 @@ def _exit(signum, frame): | {Fore.LIGHTCYAN_EX}本程序可以根据自己的哔哩哔哩账号的粉丝数,自动更改您的个人简介。 {Fore.LIGHTMAGENTA_EX}| ╰──────────────────────────────────────────────────────────────────────╯ V{VERSION}{Style.RESET_ALL}""") - cfg = config().config + cfg = Config().config api = BilibiliApi(cfg['SESSDATA'], cfg['bili_jct']) sign = Signature(cfg) if (cfg['freq'] < 15):