From 11c90624048b880e07a4f63a99cedb94a1472ba3 Mon Sep 17 00:00:00 2001 From: WittF Date: Mon, 5 Aug 2024 13:04:06 +0800 Subject: [PATCH 01/12] chore: Update problems_tab with project resources and feedback links --- tab/problems.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tab/problems.py b/tab/problems.py index d5433f3..eea3419 100644 --- a/tab/problems.py +++ b/tab/problems.py @@ -3,8 +3,13 @@ def problems_tab(): gr.Markdown(""" - -本项目使用说明书 [使用说明书](https://github.com/mikumifa/biliTickerBuy/wiki/%E6%8A%A2%E7%A5%A8%E8%AF%B4%E6%98%8E) - -本项目的提问专区 [提问专区](https://github.com/mikumifa/biliTickerBuy/discussions) -""") +- **项目资源** + - **项目主页**:[mikumifa/biliTickerBuy](https://github.com/mikumifa/biliTickerBuy) + - **讨论区**:[Discussions](https://github.com/mikumifa/biliTickerBuy/discussions) +- **问题反馈** + - [通用问题](https://github.com/mikumifa/biliTickerBuy/issues) + - [漏洞反馈](https://github.com/mikumifa/biliTickerBuy/issues/new?assignees=&labels=bug%3F&projects=&template=bug-report.yml&title=%5BBug%5D%3A+) + - [需求建议](https://github.com/mikumifa/biliTickerBuy/issues/new?assignees=&labels=enhancement&projects=&template=feature-request.yml&title=%5BFeature%5D%3A+) +- **项目文档** + - [抢票说明书](https://github.com/mikumifa/biliTickerBuy/wiki/%E6%8A%A2%E7%A5%A8%E8%AF%B4%E6%98%8E) + """) From e807cc2d1414bde20cf296789d19a8f0898193d1 Mon Sep 17 00:00:00 2001 From: WittF Date: Mon, 5 Aug 2024 13:04:51 +0800 Subject: [PATCH 02/12] feat: Update go.py with serverchan integration --- tab/go.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tab/go.py b/tab/go.py index 287bed6..2f95072 100644 --- a/tab/go.py +++ b/tab/go.py @@ -62,7 +62,7 @@ def go_tab(): > - 程序能保证用最快的速度发送订单请求,但是不保证这一次订单请求能够成功。所以不要完全依靠程序 > - 现在各个平台抢票和秒杀机制都是进抽签池抽签,网速快发请求多快在拥挤的时候基本上没有效果 > 此时就要看你有没有足够的设备和账号来提高中签率 -> - 欢迎前往[discussions](https://github.com/mikumifa/biliTickerBuy/discussions) 分享你的经验 +> - 欢迎前往 [discussions](https://github.com/mikumifa/biliTickerBuy/discussions) 分享你的经验 """) with gr.Column(): gr.Markdown( @@ -630,9 +630,9 @@ def inner_request(): if pushplusToken is not None and pushplusToken != "": PushPlusUtil.send_message(pushplusToken, "抢票成功", "前往订单中心付款吧") - serverchanToken = configDB.get("serverchanToken") - if serverchanToken is not None and serverchanToken != "": - ServerChanUtil.send_message(serverchanToken, "抢票成功", "前往订单中心付款吧") + serverchanKey = configDB.get("serverchanKey") + if serverchanKey is not None and serverchanKey != "": + ServerChanUtil.send_message(serverchanKey, "抢票成功", "前往订单中心付款吧") if audio_path is not None and audio_path != "": def play_sound_in_loop(file_path): From 8aec6d89eedf261d7ea5f519451c4deb1a3451b8 Mon Sep 17 00:00:00 2001 From: WittF Date: Mon, 5 Aug 2024 13:04:59 +0800 Subject: [PATCH 03/12] chore: Update tab names and add project information --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index a0ac995..07c078d 100644 --- a/main.py +++ b/main.py @@ -36,15 +36,15 @@ logger.add("app.log") with gr.Blocks(head=short_js, css=custom_css) as demo: gr.Markdown(header) - with gr.Tab("配置"): + with gr.Tab("生成配置"): setting_tab() - with gr.Tab("抢票"): + with gr.Tab("操作抢票"): go_tab() - with gr.Tab("训练你的验证码速度"): + with gr.Tab("过码测试"): train_tab() with gr.Tab("登录管理"): login_tab() - with gr.Tab("常见问题"): + with gr.Tab("关于项目"): problems_tab() From 3b6c216438b53e6180ce5b01b4c6a9b9f706d238 Mon Sep 17 00:00:00 2001 From: WittF Date: Mon, 5 Aug 2024 13:08:22 +0800 Subject: [PATCH 04/12] update: enhance documentation and rename configuration key --- tab/login.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tab/login.py b/tab/login.py index ab275bf..208a739 100644 --- a/tab/login.py +++ b/tab/login.py @@ -16,7 +16,7 @@ def login_tab(): > 1. 去更改账号, > 2. 查看当前程序正在使用哪个账号 > 3. 使用配置文件切换到另一个账号 -> +> 4. 配置抢票成功的提醒功能 """) with gr.Row(): username_ui = gr.Text( @@ -69,31 +69,30 @@ def add(): inputs=None, outputs=[info_ui, username_ui, gr_file_ui] ) - gr.Markdown(""" - > **微信消息推送功能如何添加** - > [Server酱](https://sct.ftqq.com/) 和 [pushplus](https://www.pushplus.plus/) - > 等哪个哥们有空写个wiki - > 留空则表示不使用提醒功能 - > 关闭直接删除token即可 - + gr.Markdown( + """ + 🗨️ 抢票成功提醒 + > 你需要去对应的网站申请key/token,然后填入下面的输入框 + > [Server酱](https://sct.ftqq.com/) | [pushplus](https://www.pushplus.plus/) + > 留空以不启用提醒功能 """) with gr.Row(): serverchan_ui = gr.Textbox( - value=configDB.get("serverchanToken") if configDB.get("serverchanToken") is not None else "", - label="Server酱的Token", + value=configDB.get("serverchanKey") if configDB.get("serverchanKey") is not None else "", + label="Server酱的SendKey", interactive=True, - info="[https://sct.ftqq.com/](https://sct.ftqq.com/)", + info="https://sct.ftqq.com/", ) pushplus_ui = gr.Textbox( value=configDB.get("pushplusToken") if configDB.get("pushplusToken") is not None else "", label="pushplus的Token", interactive=True, - info="[https://www.pushplus.plus/](https://www.pushplus.plus/)", + info="https://www.pushplus.plus/", ) def inner_input_serverchan(x): - return configDB.insert("serverchanToken", x) + return configDB.insert("serverchanKey", x) def inner_input_pushplus(x): return configDB.insert("pushplusToken", x) From 3a73e99f83ac57fb6ffd530cf3a798aaed31f1c1 Mon Sep 17 00:00:00 2001 From: WittF Date: Mon, 5 Aug 2024 13:10:38 +0800 Subject: [PATCH 05/12] Update login.py --- tab/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tab/login.py b/tab/login.py index 208a739..21efdb0 100644 --- a/tab/login.py +++ b/tab/login.py @@ -72,7 +72,7 @@ def add(): gr.Markdown( """ 🗨️ 抢票成功提醒 - > 你需要去对应的网站申请key/token,然后填入下面的输入框 + > 你需要去对应的网站获取key或token,然后填入下面的输入框 > [Server酱](https://sct.ftqq.com/) | [pushplus](https://www.pushplus.plus/) > 留空以不启用提醒功能 """) From 6f848488093bee07f673af900a7f4289f768744a Mon Sep 17 00:00:00 2001 From: WittF Date: Mon, 5 Aug 2024 13:15:22 +0800 Subject: [PATCH 06/12] chore: Update login.py and WebhookUtil.py --- tab/login.py | 2 +- util/WebhookUtil.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 util/WebhookUtil.py diff --git a/tab/login.py b/tab/login.py index 21efdb0..8ec414d 100644 --- a/tab/login.py +++ b/tab/login.py @@ -73,7 +73,7 @@ def add(): """ 🗨️ 抢票成功提醒 > 你需要去对应的网站获取key或token,然后填入下面的输入框 - > [Server酱](https://sct.ftqq.com/) | [pushplus](https://www.pushplus.plus/) + > [Server酱](https://sct.ftqq.com/sendkey) | [pushplus](https://www.pushplus.plus/uc.html) > 留空以不启用提醒功能 """) with gr.Row(): diff --git a/util/WebhookUtil.py b/util/WebhookUtil.py new file mode 100644 index 0000000..299a90b --- /dev/null +++ b/util/WebhookUtil.py @@ -0,0 +1,26 @@ +import json +import requests +import loguru + +def send_webhook(url, payload): + """ + 发送Webhook通知。 + + 参数: + - url (str): Webhook的URL。 + - payload (dict): 要发送的数据,包含标题和描述等。 + + 返回: + - None + """ + headers = { + "Content-Type": "application/json" + } + try: + response = requests.post(url, headers=headers, data=json.dumps(payload)) + response.raise_for_status() # 如果发生错误,则抛出HTTPError异常 + loguru.logger.info("Webhook消息发送成功") + except requests.exceptions.HTTPError as http_err: + loguru.logger.error(f"HTTP错误发生: {http_err}") + except Exception as err: + loguru.logger.error(f"消息发送失败: {err}") From 131cc9d24fa7478858197adb91ddb01433b146f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 05:16:06 +0000 Subject: [PATCH 07/12] docs(contributor): contrib-readme-action has updated readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ebefd63..5286bdb 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,13 @@ Running on local URL: http://127.0.0.1:xxx + -
+ + WittF +
+ W1ttF +
+
mikumifa @@ -78,13 +85,6 @@ Running on local URL: http://127.0.0.1:xxx gpc123456 - - WittF -
- W1ttF -
-
Amorter From 8c914f7ee2cc436310f05df61566b65d8c1c4351 Mon Sep 17 00:00:00 2001 From: WittF Date: Sat, 17 Aug 2024 22:56:11 +0800 Subject: [PATCH 08/12] chore: Update problems_tab with project resources and feedback links --- tab/problems.py | 10 ++++------ util/WebhookUtil.py | 26 -------------------------- 2 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 util/WebhookUtil.py diff --git a/tab/problems.py b/tab/problems.py index eea3419..69e60b5 100644 --- a/tab/problems.py +++ b/tab/problems.py @@ -3,13 +3,11 @@ def problems_tab(): gr.Markdown(""" -- **项目资源** - - **项目主页**:[mikumifa/biliTickerBuy](https://github.com/mikumifa/biliTickerBuy) - - **讨论区**:[Discussions](https://github.com/mikumifa/biliTickerBuy/discussions) -- **问题反馈** - - [通用问题](https://github.com/mikumifa/biliTickerBuy/issues) +- **项目地址**:[mikumifa/biliTickerBuy](https://github.com/mikumifa/biliTickerBuy) +- **讨论区**:[Discussions](https://github.com/mikumifa/biliTickerBuy/discussions) +- **问题反馈**:[Issues](https://github.com/mikumifa/biliTickerBuy/issues) - [漏洞反馈](https://github.com/mikumifa/biliTickerBuy/issues/new?assignees=&labels=bug%3F&projects=&template=bug-report.yml&title=%5BBug%5D%3A+) - [需求建议](https://github.com/mikumifa/biliTickerBuy/issues/new?assignees=&labels=enhancement&projects=&template=feature-request.yml&title=%5BFeature%5D%3A+) -- **项目文档** +- **文档**:[Wiki](https://github.com/mikumifa/biliTickerBuy/wiki) - [抢票说明书](https://github.com/mikumifa/biliTickerBuy/wiki/%E6%8A%A2%E7%A5%A8%E8%AF%B4%E6%98%8E) """) diff --git a/util/WebhookUtil.py b/util/WebhookUtil.py deleted file mode 100644 index 299a90b..0000000 --- a/util/WebhookUtil.py +++ /dev/null @@ -1,26 +0,0 @@ -import json -import requests -import loguru - -def send_webhook(url, payload): - """ - 发送Webhook通知。 - - 参数: - - url (str): Webhook的URL。 - - payload (dict): 要发送的数据,包含标题和描述等。 - - 返回: - - None - """ - headers = { - "Content-Type": "application/json" - } - try: - response = requests.post(url, headers=headers, data=json.dumps(payload)) - response.raise_for_status() # 如果发生错误,则抛出HTTPError异常 - loguru.logger.info("Webhook消息发送成功") - except requests.exceptions.HTTPError as http_err: - loguru.logger.error(f"HTTP错误发生: {http_err}") - except Exception as err: - loguru.logger.error(f"消息发送失败: {err}") From ac1b6b77d028ce33fe2530c16afa395630335bec Mon Sep 17 00:00:00 2001 From: WittF Date: Sat, 17 Aug 2024 23:00:00 +0800 Subject: [PATCH 09/12] =?UTF-8?q?chore:=20Update=20tab=20label=20to=20"?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=B4=E6=98=8E"=20in=20main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 07c078d..78ebdd7 100644 --- a/main.py +++ b/main.py @@ -44,7 +44,7 @@ train_tab() with gr.Tab("登录管理"): login_tab() - with gr.Tab("关于项目"): + with gr.Tab("项目说明"): problems_tab() From be471c86c07db17b6965634ea8d2f30042e956d4 Mon Sep 17 00:00:00 2001 From: WittF Date: Sat, 17 Aug 2024 23:03:55 +0800 Subject: [PATCH 10/12] chore: Update PushPlusUtil.py error message to use consistent capitalization --- util/PushPlusUtil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/PushPlusUtil.py b/util/PushPlusUtil.py index 42c4dfb..c599ee3 100644 --- a/util/PushPlusUtil.py +++ b/util/PushPlusUtil.py @@ -22,7 +22,7 @@ def send_message(token, content, title): } requests.post(url, headers=headers, data=json.dumps(data)) except Exception as e: - loguru.logger.info("pushplus消息发送失败") + loguru.logger.info("PushPlus消息发送失败") From 6c1100b8bc5361635947091311e8ccc36b9b323a Mon Sep 17 00:00:00 2001 From: WittF Date: Sat, 17 Aug 2024 23:16:30 +0800 Subject: [PATCH 11/12] Update login.py --- tab/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tab/login.py b/tab/login.py index 8ec414d..afcab12 100644 --- a/tab/login.py +++ b/tab/login.py @@ -86,7 +86,7 @@ def add(): pushplus_ui = gr.Textbox( value=configDB.get("pushplusToken") if configDB.get("pushplusToken") is not None else "", - label="pushplus的Token", + label="PushPlus的Token", interactive=True, info="https://www.pushplus.plus/", ) From e7f6db6d0ee16082df926c3bf3cf119fc6db758b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:11:45 +0000 Subject: [PATCH 12/12] docs(contributor): contrib-readme-action has updated readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 850a267..9c4ea89 100644 --- a/README.md +++ b/README.md @@ -65,17 +65,17 @@ Running on local URL: http://127.0.0.1:xxx
- - WittF + + mikumifa
- W1ttF + mikumifa
- - mikumifa + + WittF
- mikumifa + W1ttF