bilitickerbuy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bilitickerbuy-0.1.0/LICENSE +21 -0
- bilitickerbuy-0.1.0/PKG-INFO +109 -0
- bilitickerbuy-0.1.0/README.md +83 -0
- bilitickerbuy-0.1.0/app_cmd/__init__.py +3 -0
- bilitickerbuy-0.1.0/app_cmd/buy.py +102 -0
- bilitickerbuy-0.1.0/app_cmd/ticker.py +51 -0
- bilitickerbuy-0.1.0/bilitickerbuy.egg-info/PKG-INFO +109 -0
- bilitickerbuy-0.1.0/bilitickerbuy.egg-info/SOURCES.txt +37 -0
- bilitickerbuy-0.1.0/bilitickerbuy.egg-info/dependency_links.txt +1 -0
- bilitickerbuy-0.1.0/bilitickerbuy.egg-info/entry_points.txt +3 -0
- bilitickerbuy-0.1.0/bilitickerbuy.egg-info/requires.txt +15 -0
- bilitickerbuy-0.1.0/bilitickerbuy.egg-info/top_level.txt +7 -0
- bilitickerbuy-0.1.0/main.py +143 -0
- bilitickerbuy-0.1.0/pyproject.toml +45 -0
- bilitickerbuy-0.1.0/setup.cfg +4 -0
- bilitickerbuy-0.1.0/tab/__init__.py +3 -0
- bilitickerbuy-0.1.0/tab/go.py +541 -0
- bilitickerbuy-0.1.0/tab/log.py +25 -0
- bilitickerbuy-0.1.0/tab/problems.py +23 -0
- bilitickerbuy-0.1.0/tab/settings.py +633 -0
- bilitickerbuy-0.1.0/task/__init__.py +3 -0
- bilitickerbuy-0.1.0/task/buy.py +295 -0
- bilitickerbuy-0.1.0/task/endpoint.py +40 -0
- bilitickerbuy-0.1.0/util/AudioUtil.py +34 -0
- bilitickerbuy-0.1.0/util/BarkUtil.py +34 -0
- bilitickerbuy-0.1.0/util/BiliRequest.py +107 -0
- bilitickerbuy-0.1.0/util/CTokenUtil.py +98 -0
- bilitickerbuy-0.1.0/util/CookieManager.py +71 -0
- bilitickerbuy-0.1.0/util/KVDatabase.py +38 -0
- bilitickerbuy-0.1.0/util/LogConfig.py +37 -0
- bilitickerbuy-0.1.0/util/Notifier.py +310 -0
- bilitickerbuy-0.1.0/util/NtfyUtil.py +303 -0
- bilitickerbuy-0.1.0/util/ProxyTester.py +202 -0
- bilitickerbuy-0.1.0/util/PushPlusUtil.py +23 -0
- bilitickerbuy-0.1.0/util/RandomMessages.py +34 -0
- bilitickerbuy-0.1.0/util/ServerChanUtil.py +41 -0
- bilitickerbuy-0.1.0/util/TimeUtil.py +51 -0
- bilitickerbuy-0.1.0/util/TokenUtil.py +60 -0
- bilitickerbuy-0.1.0/util/__init__.py +111 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 mikumifa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bilitickerbuy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Project-URL: Homepage, https://github.com/mikumifa/biliTickerBuy
|
|
6
|
+
Project-URL: Source, https://github.com/mikumifa/biliTickerBuy
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: gradio~=4.44.1
|
|
11
|
+
Requires-Dist: gradio-calendar~=0.0.6
|
|
12
|
+
Requires-Dist: gradio-log~=0.0.4
|
|
13
|
+
Requires-Dist: httpx[socks]>=0.28.1
|
|
14
|
+
Requires-Dist: loguru~=0.7.2
|
|
15
|
+
Requires-Dist: ntplib~=0.4.0
|
|
16
|
+
Requires-Dist: numpy~=1.26.4
|
|
17
|
+
Requires-Dist: playsound3~=3.2.2
|
|
18
|
+
Requires-Dist: pydantic~=2.8.2
|
|
19
|
+
Requires-Dist: qrcode>=7.4.2
|
|
20
|
+
Requires-Dist: requests[socks]~=2.31.0
|
|
21
|
+
Requires-Dist: retry~=0.9.2
|
|
22
|
+
Requires-Dist: setuptools~=65.5.1
|
|
23
|
+
Requires-Dist: tinydb~=4.8.0
|
|
24
|
+
Requires-Dist: Pillow~=10.3.0
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
<a href="https://github.com/mikumifa/biliTickerBuy" target="_blank">
|
|
29
|
+
<img width="160" src="assets/icon.ico" alt="logo">
|
|
30
|
+
</a>
|
|
31
|
+
<h2 id="koishi">biliTickerBuy</h1>
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
<!-- GitHub Downloads -->
|
|
35
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/releases">
|
|
36
|
+
<img src="https://img.shields.io/github/downloads/mikumifa/biliTickerBuy/total" alt="GitHub all releases">
|
|
37
|
+
</a>
|
|
38
|
+
<!-- GitHub Release Version -->
|
|
39
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/releases">
|
|
40
|
+
<img src="https://img.shields.io/github/v/release/mikumifa/biliTickerBuy" alt="GitHub release (with filter)">
|
|
41
|
+
</a>
|
|
42
|
+
<!-- GitHub Issues -->
|
|
43
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/issues">
|
|
44
|
+
<img src="https://img.shields.io/github/issues/mikumifa/biliTickerBuy" alt="GitHub issues">
|
|
45
|
+
</a>
|
|
46
|
+
<!-- GitHub Stars -->
|
|
47
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/stargazers">
|
|
48
|
+
<img src="https://img.shields.io/github/stars/mikumifa/biliTickerBuy" alt="GitHub Repo stars">
|
|
49
|
+
</a>
|
|
50
|
+
</p>
|
|
51
|
+
<a href="https://trendshift.io/repositories/11145" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11145" alt="mikumifa%2FbiliTickerBuy | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
52
|
+
|
|
53
|
+
这是一个开源免费,简单易用的 B 站会员购辅助工具
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
## 💻 快速安装
|
|
58
|
+
|
|
59
|
+
方法一: 从 github 上[下载](https://github.com/mikumifa/biliTickerBuy/releases)
|
|
60
|
+
|
|
61
|
+
方法二: 如果没有您使用系统的已构建版本,请前往[指南](https://github.com/mikumifa/biliTickerBuy/wiki/Docker%E8%BF%90%E8%A1%8C%E6%96%B9%E6%B3%95)
|
|
62
|
+
|
|
63
|
+
方法三: 仓库支持通过 `pip install .` 安装,安装后可以直接使用 `btb` 命令运行。示例:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 直接启动ui
|
|
67
|
+
btb
|
|
68
|
+
# 根据配置文件购票
|
|
69
|
+
btb buy ./your_config.json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 👀 使用说明书
|
|
73
|
+
|
|
74
|
+
前往飞书: https://n1x87b5cqay.feishu.cn/wiki/Eg4xwt3Dbiah02k1WqOcVk2YnMd
|
|
75
|
+
|
|
76
|
+
## ❗ 项目问题
|
|
77
|
+
|
|
78
|
+
程序使用问题: [点此链接前往 discussions](https://github.com/mikumifa/biliTickerBuy/discussions)
|
|
79
|
+
|
|
80
|
+
反馈程序 BUG 或者提新功能建议: [点此链接向项目提出反馈 BUG](https://github.com/mikumifa/biliTickerBuy/issues/new/choose)
|
|
81
|
+
|
|
82
|
+
## 📩 免责声明
|
|
83
|
+
|
|
84
|
+
本项目遵循 MIT License 许可协议,仅供个人学习与研究使用。请勿将本项目用于任何商业牟利行为,亦严禁用于任何形式的代抢、违法行为或违反相关平台规则的用途。由此产生的一切后果均由使用者自行承担,与本人无关。
|
|
85
|
+
|
|
86
|
+
若您 fork 或使用本项目,请务必遵守相关法律法规与目标平台规则。
|
|
87
|
+
|
|
88
|
+
## 💡 关于访问频率与并发控制
|
|
89
|
+
|
|
90
|
+
本项目在设计时严格遵循「非侵入式」原则,避免对目标服务器(如 Bilibili)造成任何干扰。
|
|
91
|
+
|
|
92
|
+
所有网络请求的时间间隔均由用户自行配置,默认值模拟正常用户的手动操作速度。程序默认单线程运行,无并发任务。遇到请求失败时,程序会进行有限次数的重试,并在重试之间加入适当的延时,避免形成高频打点。项目完全依赖平台公开接口及网页结构,不含风控规避、API 劫持等破坏性手段。
|
|
93
|
+
|
|
94
|
+
## 🛡️ 平台尊重声明
|
|
95
|
+
|
|
96
|
+
本程序设计时已尽可能控制请求频率,避免对 Bilibili 服务器造成任何明显负载或影响。项目仅作为学习用途,不具备大规模、高并发的能力,亦无任何恶意行为或干扰服务的企图。
|
|
97
|
+
|
|
98
|
+
如本项目中存在侵犯 Bilibili 公司合法权益的内容,请通过邮箱 [1055069518@qq.com](mailto:1055069518@qq.com) 与我联系,我将第一时间下架相关内容并删除本仓库。对此造成的不便,我深表歉意,感谢您的理解与包容。
|
|
99
|
+
|
|
100
|
+
## 🤩 项目贡献者
|
|
101
|
+
|
|
102
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/graphs/contributors">
|
|
103
|
+
<img src="https://contrib.rocks/image?repo=mikumifa/biliTickerBuy&preview=true&max=&columns=" />
|
|
104
|
+
</a>
|
|
105
|
+
<br /><br />
|
|
106
|
+
|
|
107
|
+
## ⭐️ Star History
|
|
108
|
+
|
|
109
|
+
[](https://www.star-history.com/#mikumifa/biliTickerBuy&Date)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://github.com/mikumifa/biliTickerBuy" target="_blank">
|
|
3
|
+
<img width="160" src="assets/icon.ico" alt="logo">
|
|
4
|
+
</a>
|
|
5
|
+
<h2 id="koishi">biliTickerBuy</h1>
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<!-- GitHub Downloads -->
|
|
9
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/releases">
|
|
10
|
+
<img src="https://img.shields.io/github/downloads/mikumifa/biliTickerBuy/total" alt="GitHub all releases">
|
|
11
|
+
</a>
|
|
12
|
+
<!-- GitHub Release Version -->
|
|
13
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/releases">
|
|
14
|
+
<img src="https://img.shields.io/github/v/release/mikumifa/biliTickerBuy" alt="GitHub release (with filter)">
|
|
15
|
+
</a>
|
|
16
|
+
<!-- GitHub Issues -->
|
|
17
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/issues">
|
|
18
|
+
<img src="https://img.shields.io/github/issues/mikumifa/biliTickerBuy" alt="GitHub issues">
|
|
19
|
+
</a>
|
|
20
|
+
<!-- GitHub Stars -->
|
|
21
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/stargazers">
|
|
22
|
+
<img src="https://img.shields.io/github/stars/mikumifa/biliTickerBuy" alt="GitHub Repo stars">
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
<a href="https://trendshift.io/repositories/11145" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11145" alt="mikumifa%2FbiliTickerBuy | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
26
|
+
|
|
27
|
+
这是一个开源免费,简单易用的 B 站会员购辅助工具
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
## 💻 快速安装
|
|
32
|
+
|
|
33
|
+
方法一: 从 github 上[下载](https://github.com/mikumifa/biliTickerBuy/releases)
|
|
34
|
+
|
|
35
|
+
方法二: 如果没有您使用系统的已构建版本,请前往[指南](https://github.com/mikumifa/biliTickerBuy/wiki/Docker%E8%BF%90%E8%A1%8C%E6%96%B9%E6%B3%95)
|
|
36
|
+
|
|
37
|
+
方法三: 仓库支持通过 `pip install .` 安装,安装后可以直接使用 `btb` 命令运行。示例:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# 直接启动ui
|
|
41
|
+
btb
|
|
42
|
+
# 根据配置文件购票
|
|
43
|
+
btb buy ./your_config.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 👀 使用说明书
|
|
47
|
+
|
|
48
|
+
前往飞书: https://n1x87b5cqay.feishu.cn/wiki/Eg4xwt3Dbiah02k1WqOcVk2YnMd
|
|
49
|
+
|
|
50
|
+
## ❗ 项目问题
|
|
51
|
+
|
|
52
|
+
程序使用问题: [点此链接前往 discussions](https://github.com/mikumifa/biliTickerBuy/discussions)
|
|
53
|
+
|
|
54
|
+
反馈程序 BUG 或者提新功能建议: [点此链接向项目提出反馈 BUG](https://github.com/mikumifa/biliTickerBuy/issues/new/choose)
|
|
55
|
+
|
|
56
|
+
## 📩 免责声明
|
|
57
|
+
|
|
58
|
+
本项目遵循 MIT License 许可协议,仅供个人学习与研究使用。请勿将本项目用于任何商业牟利行为,亦严禁用于任何形式的代抢、违法行为或违反相关平台规则的用途。由此产生的一切后果均由使用者自行承担,与本人无关。
|
|
59
|
+
|
|
60
|
+
若您 fork 或使用本项目,请务必遵守相关法律法规与目标平台规则。
|
|
61
|
+
|
|
62
|
+
## 💡 关于访问频率与并发控制
|
|
63
|
+
|
|
64
|
+
本项目在设计时严格遵循「非侵入式」原则,避免对目标服务器(如 Bilibili)造成任何干扰。
|
|
65
|
+
|
|
66
|
+
所有网络请求的时间间隔均由用户自行配置,默认值模拟正常用户的手动操作速度。程序默认单线程运行,无并发任务。遇到请求失败时,程序会进行有限次数的重试,并在重试之间加入适当的延时,避免形成高频打点。项目完全依赖平台公开接口及网页结构,不含风控规避、API 劫持等破坏性手段。
|
|
67
|
+
|
|
68
|
+
## 🛡️ 平台尊重声明
|
|
69
|
+
|
|
70
|
+
本程序设计时已尽可能控制请求频率,避免对 Bilibili 服务器造成任何明显负载或影响。项目仅作为学习用途,不具备大规模、高并发的能力,亦无任何恶意行为或干扰服务的企图。
|
|
71
|
+
|
|
72
|
+
如本项目中存在侵犯 Bilibili 公司合法权益的内容,请通过邮箱 [1055069518@qq.com](mailto:1055069518@qq.com) 与我联系,我将第一时间下架相关内容并删除本仓库。对此造成的不便,我深表歉意,感谢您的理解与包容。
|
|
73
|
+
|
|
74
|
+
## 🤩 项目贡献者
|
|
75
|
+
|
|
76
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/graphs/contributors">
|
|
77
|
+
<img src="https://contrib.rocks/image?repo=mikumifa/biliTickerBuy&preview=true&max=&columns=" />
|
|
78
|
+
</a>
|
|
79
|
+
<br /><br />
|
|
80
|
+
|
|
81
|
+
## ⭐️ Star History
|
|
82
|
+
|
|
83
|
+
[](https://www.star-history.com/#mikumifa/biliTickerBuy&Date)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
from argparse import Namespace
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from util import GlobalStatusInstance
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def buy_cmd(args: Namespace):
|
|
8
|
+
from util.LogConfig import loguru_config
|
|
9
|
+
import uuid
|
|
10
|
+
|
|
11
|
+
from util import LOG_DIR
|
|
12
|
+
from task.buy import buy
|
|
13
|
+
from loguru import logger
|
|
14
|
+
|
|
15
|
+
def load_tickets_info(tickets_info: str) -> tuple[str, str | None]:
|
|
16
|
+
config_path = os.path.expanduser(tickets_info)
|
|
17
|
+
if os.path.isfile(config_path):
|
|
18
|
+
logger.info(f"使用配置文件:{config_path}")
|
|
19
|
+
try:
|
|
20
|
+
with open(config_path, "r", encoding="utf-8") as config_file:
|
|
21
|
+
return config_file.read(), config_path
|
|
22
|
+
except OSError as exc:
|
|
23
|
+
raise SystemExit(f"读取配置文件失败: {exc}") from exc
|
|
24
|
+
return tickets_info, None
|
|
25
|
+
|
|
26
|
+
tickets_info, config_path = load_tickets_info(args.tickets_info)
|
|
27
|
+
filename = os.path.basename(config_path) if config_path else "default"
|
|
28
|
+
filename_only = os.path.basename(filename)
|
|
29
|
+
if getattr(args, "web", False):
|
|
30
|
+
log_file = loguru_config(
|
|
31
|
+
LOG_DIR, f"{uuid.uuid1()}.log", enable_console=False, file_colorize=True
|
|
32
|
+
)
|
|
33
|
+
from task.endpoint import start_heartbeat_thread
|
|
34
|
+
import gradio_client
|
|
35
|
+
import gradio as gr
|
|
36
|
+
from gradio_log import Log
|
|
37
|
+
|
|
38
|
+
with gr.Blocks(
|
|
39
|
+
head="""<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>""",
|
|
40
|
+
title=f"{filename_only}",
|
|
41
|
+
fill_height=True,
|
|
42
|
+
) as demo:
|
|
43
|
+
gr.Markdown(
|
|
44
|
+
f"""
|
|
45
|
+
# 当前抢票 {filename_only}
|
|
46
|
+
> 你可以在这里查看程序的运行日志
|
|
47
|
+
"""
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
Log(
|
|
51
|
+
log_file,
|
|
52
|
+
dark=True,
|
|
53
|
+
scale=1,
|
|
54
|
+
xterm_log_level="info",
|
|
55
|
+
xterm_scrollback=5000,
|
|
56
|
+
elem_classes="h-full",
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def exit_program():
|
|
60
|
+
print(f"{filename_only} ,关闭程序...")
|
|
61
|
+
os._exit(0)
|
|
62
|
+
|
|
63
|
+
btn = gr.Button("关闭程序")
|
|
64
|
+
btn.click(fn=exit_program)
|
|
65
|
+
|
|
66
|
+
print(f"抢票日志路径: {log_file}")
|
|
67
|
+
print(f"运行程序网址 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓ {filename_only} ")
|
|
68
|
+
demo.launch(
|
|
69
|
+
server_name=args.server_name,
|
|
70
|
+
server_port=args.port,
|
|
71
|
+
share=args.share,
|
|
72
|
+
inbrowser=True,
|
|
73
|
+
prevent_thread_lock=True,
|
|
74
|
+
)
|
|
75
|
+
client = gradio_client.Client(args.endpoint_url)
|
|
76
|
+
assert demo.local_url
|
|
77
|
+
GlobalStatusInstance.nowTask = filename_only
|
|
78
|
+
start_heartbeat_thread(
|
|
79
|
+
client,
|
|
80
|
+
self_url=demo.local_url,
|
|
81
|
+
to_url=args.endpoint_url,
|
|
82
|
+
)
|
|
83
|
+
else:
|
|
84
|
+
log_file = loguru_config(
|
|
85
|
+
LOG_DIR, f"{uuid.uuid1()}.log", enable_console=True, file_colorize=True
|
|
86
|
+
)
|
|
87
|
+
buy(
|
|
88
|
+
tickets_info,
|
|
89
|
+
args.time_start,
|
|
90
|
+
args.interval,
|
|
91
|
+
args.audio_path,
|
|
92
|
+
args.pushplusToken,
|
|
93
|
+
args.serverchanKey,
|
|
94
|
+
args.barkToken,
|
|
95
|
+
args.https_proxys,
|
|
96
|
+
args.serverchan3ApiUrl,
|
|
97
|
+
args.ntfy_url,
|
|
98
|
+
args.ntfy_username,
|
|
99
|
+
args.ntfy_password,
|
|
100
|
+
not args.hide_random_message,
|
|
101
|
+
)
|
|
102
|
+
logger.info("抢票完成后退出程序。。。。。")
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import loguru
|
|
3
|
+
import gradio as gr
|
|
4
|
+
import threading
|
|
5
|
+
from argparse import Namespace
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def exit_app_ui():
|
|
9
|
+
loguru.logger.info("程序退出")
|
|
10
|
+
threading.Timer(2.0, lambda: os._exit(0)).start()
|
|
11
|
+
gr.Info("⚠️ 程序将在弹出Error提示后退出 ⚠️")
|
|
12
|
+
return
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def ticker_cmd(args: Namespace):
|
|
16
|
+
from tab.go import go_tab
|
|
17
|
+
from tab.problems import problems_tab
|
|
18
|
+
from tab.settings import setting_tab
|
|
19
|
+
from tab.log import log_tab
|
|
20
|
+
|
|
21
|
+
from util.LogConfig import loguru_config
|
|
22
|
+
from util import LOG_DIR
|
|
23
|
+
|
|
24
|
+
loguru_config(LOG_DIR, "app.log", enable_console=True, file_colorize=False)
|
|
25
|
+
|
|
26
|
+
header = """
|
|
27
|
+
# B 站会员购抢票🌈
|
|
28
|
+
|
|
29
|
+
⚠️此项目完全开源免费 ([项目地址](https://github.com/mikumifa/biliTickerBuy)),切勿进行盈利,所造成的后果与本人无关。
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
with gr.Blocks(
|
|
33
|
+
title="biliTickerBuy",
|
|
34
|
+
head="""<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>""",
|
|
35
|
+
) as demo:
|
|
36
|
+
gr.Markdown(header)
|
|
37
|
+
with gr.Tab("生成配置"):
|
|
38
|
+
setting_tab()
|
|
39
|
+
with gr.Tab("操作抢票"):
|
|
40
|
+
go_tab(demo)
|
|
41
|
+
with gr.Tab("项目说明"):
|
|
42
|
+
problems_tab()
|
|
43
|
+
with gr.Tab("日志查看"):
|
|
44
|
+
log_tab()
|
|
45
|
+
|
|
46
|
+
demo.launch(
|
|
47
|
+
share=args.share,
|
|
48
|
+
inbrowser=True,
|
|
49
|
+
server_name=args.server_name,
|
|
50
|
+
server_port=args.port,
|
|
51
|
+
)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bilitickerbuy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Project-URL: Homepage, https://github.com/mikumifa/biliTickerBuy
|
|
6
|
+
Project-URL: Source, https://github.com/mikumifa/biliTickerBuy
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: gradio~=4.44.1
|
|
11
|
+
Requires-Dist: gradio-calendar~=0.0.6
|
|
12
|
+
Requires-Dist: gradio-log~=0.0.4
|
|
13
|
+
Requires-Dist: httpx[socks]>=0.28.1
|
|
14
|
+
Requires-Dist: loguru~=0.7.2
|
|
15
|
+
Requires-Dist: ntplib~=0.4.0
|
|
16
|
+
Requires-Dist: numpy~=1.26.4
|
|
17
|
+
Requires-Dist: playsound3~=3.2.2
|
|
18
|
+
Requires-Dist: pydantic~=2.8.2
|
|
19
|
+
Requires-Dist: qrcode>=7.4.2
|
|
20
|
+
Requires-Dist: requests[socks]~=2.31.0
|
|
21
|
+
Requires-Dist: retry~=0.9.2
|
|
22
|
+
Requires-Dist: setuptools~=65.5.1
|
|
23
|
+
Requires-Dist: tinydb~=4.8.0
|
|
24
|
+
Requires-Dist: Pillow~=10.3.0
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
<a href="https://github.com/mikumifa/biliTickerBuy" target="_blank">
|
|
29
|
+
<img width="160" src="assets/icon.ico" alt="logo">
|
|
30
|
+
</a>
|
|
31
|
+
<h2 id="koishi">biliTickerBuy</h1>
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
<!-- GitHub Downloads -->
|
|
35
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/releases">
|
|
36
|
+
<img src="https://img.shields.io/github/downloads/mikumifa/biliTickerBuy/total" alt="GitHub all releases">
|
|
37
|
+
</a>
|
|
38
|
+
<!-- GitHub Release Version -->
|
|
39
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/releases">
|
|
40
|
+
<img src="https://img.shields.io/github/v/release/mikumifa/biliTickerBuy" alt="GitHub release (with filter)">
|
|
41
|
+
</a>
|
|
42
|
+
<!-- GitHub Issues -->
|
|
43
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/issues">
|
|
44
|
+
<img src="https://img.shields.io/github/issues/mikumifa/biliTickerBuy" alt="GitHub issues">
|
|
45
|
+
</a>
|
|
46
|
+
<!-- GitHub Stars -->
|
|
47
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/stargazers">
|
|
48
|
+
<img src="https://img.shields.io/github/stars/mikumifa/biliTickerBuy" alt="GitHub Repo stars">
|
|
49
|
+
</a>
|
|
50
|
+
</p>
|
|
51
|
+
<a href="https://trendshift.io/repositories/11145" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11145" alt="mikumifa%2FbiliTickerBuy | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
52
|
+
|
|
53
|
+
这是一个开源免费,简单易用的 B 站会员购辅助工具
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
## 💻 快速安装
|
|
58
|
+
|
|
59
|
+
方法一: 从 github 上[下载](https://github.com/mikumifa/biliTickerBuy/releases)
|
|
60
|
+
|
|
61
|
+
方法二: 如果没有您使用系统的已构建版本,请前往[指南](https://github.com/mikumifa/biliTickerBuy/wiki/Docker%E8%BF%90%E8%A1%8C%E6%96%B9%E6%B3%95)
|
|
62
|
+
|
|
63
|
+
方法三: 仓库支持通过 `pip install .` 安装,安装后可以直接使用 `btb` 命令运行。示例:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 直接启动ui
|
|
67
|
+
btb
|
|
68
|
+
# 根据配置文件购票
|
|
69
|
+
btb buy ./your_config.json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 👀 使用说明书
|
|
73
|
+
|
|
74
|
+
前往飞书: https://n1x87b5cqay.feishu.cn/wiki/Eg4xwt3Dbiah02k1WqOcVk2YnMd
|
|
75
|
+
|
|
76
|
+
## ❗ 项目问题
|
|
77
|
+
|
|
78
|
+
程序使用问题: [点此链接前往 discussions](https://github.com/mikumifa/biliTickerBuy/discussions)
|
|
79
|
+
|
|
80
|
+
反馈程序 BUG 或者提新功能建议: [点此链接向项目提出反馈 BUG](https://github.com/mikumifa/biliTickerBuy/issues/new/choose)
|
|
81
|
+
|
|
82
|
+
## 📩 免责声明
|
|
83
|
+
|
|
84
|
+
本项目遵循 MIT License 许可协议,仅供个人学习与研究使用。请勿将本项目用于任何商业牟利行为,亦严禁用于任何形式的代抢、违法行为或违反相关平台规则的用途。由此产生的一切后果均由使用者自行承担,与本人无关。
|
|
85
|
+
|
|
86
|
+
若您 fork 或使用本项目,请务必遵守相关法律法规与目标平台规则。
|
|
87
|
+
|
|
88
|
+
## 💡 关于访问频率与并发控制
|
|
89
|
+
|
|
90
|
+
本项目在设计时严格遵循「非侵入式」原则,避免对目标服务器(如 Bilibili)造成任何干扰。
|
|
91
|
+
|
|
92
|
+
所有网络请求的时间间隔均由用户自行配置,默认值模拟正常用户的手动操作速度。程序默认单线程运行,无并发任务。遇到请求失败时,程序会进行有限次数的重试,并在重试之间加入适当的延时,避免形成高频打点。项目完全依赖平台公开接口及网页结构,不含风控规避、API 劫持等破坏性手段。
|
|
93
|
+
|
|
94
|
+
## 🛡️ 平台尊重声明
|
|
95
|
+
|
|
96
|
+
本程序设计时已尽可能控制请求频率,避免对 Bilibili 服务器造成任何明显负载或影响。项目仅作为学习用途,不具备大规模、高并发的能力,亦无任何恶意行为或干扰服务的企图。
|
|
97
|
+
|
|
98
|
+
如本项目中存在侵犯 Bilibili 公司合法权益的内容,请通过邮箱 [1055069518@qq.com](mailto:1055069518@qq.com) 与我联系,我将第一时间下架相关内容并删除本仓库。对此造成的不便,我深表歉意,感谢您的理解与包容。
|
|
99
|
+
|
|
100
|
+
## 🤩 项目贡献者
|
|
101
|
+
|
|
102
|
+
<a href="https://github.com/mikumifa/biliTickerBuy/graphs/contributors">
|
|
103
|
+
<img src="https://contrib.rocks/image?repo=mikumifa/biliTickerBuy&preview=true&max=&columns=" />
|
|
104
|
+
</a>
|
|
105
|
+
<br /><br />
|
|
106
|
+
|
|
107
|
+
## ⭐️ Star History
|
|
108
|
+
|
|
109
|
+
[](https://www.star-history.com/#mikumifa/biliTickerBuy&Date)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
main.py
|
|
4
|
+
pyproject.toml
|
|
5
|
+
app_cmd/__init__.py
|
|
6
|
+
app_cmd/buy.py
|
|
7
|
+
app_cmd/ticker.py
|
|
8
|
+
bilitickerbuy.egg-info/PKG-INFO
|
|
9
|
+
bilitickerbuy.egg-info/SOURCES.txt
|
|
10
|
+
bilitickerbuy.egg-info/dependency_links.txt
|
|
11
|
+
bilitickerbuy.egg-info/entry_points.txt
|
|
12
|
+
bilitickerbuy.egg-info/requires.txt
|
|
13
|
+
bilitickerbuy.egg-info/top_level.txt
|
|
14
|
+
tab/__init__.py
|
|
15
|
+
tab/go.py
|
|
16
|
+
tab/log.py
|
|
17
|
+
tab/problems.py
|
|
18
|
+
tab/settings.py
|
|
19
|
+
task/__init__.py
|
|
20
|
+
task/buy.py
|
|
21
|
+
task/endpoint.py
|
|
22
|
+
util/AudioUtil.py
|
|
23
|
+
util/BarkUtil.py
|
|
24
|
+
util/BiliRequest.py
|
|
25
|
+
util/CTokenUtil.py
|
|
26
|
+
util/CookieManager.py
|
|
27
|
+
util/KVDatabase.py
|
|
28
|
+
util/LogConfig.py
|
|
29
|
+
util/Notifier.py
|
|
30
|
+
util/NtfyUtil.py
|
|
31
|
+
util/ProxyTester.py
|
|
32
|
+
util/PushPlusUtil.py
|
|
33
|
+
util/RandomMessages.py
|
|
34
|
+
util/ServerChanUtil.py
|
|
35
|
+
util/TimeUtil.py
|
|
36
|
+
util/TokenUtil.py
|
|
37
|
+
util/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
gradio~=4.44.1
|
|
2
|
+
gradio-calendar~=0.0.6
|
|
3
|
+
gradio-log~=0.0.4
|
|
4
|
+
httpx[socks]>=0.28.1
|
|
5
|
+
loguru~=0.7.2
|
|
6
|
+
ntplib~=0.4.0
|
|
7
|
+
numpy~=1.26.4
|
|
8
|
+
playsound3~=3.2.2
|
|
9
|
+
pydantic~=2.8.2
|
|
10
|
+
qrcode>=7.4.2
|
|
11
|
+
requests[socks]~=2.31.0
|
|
12
|
+
retry~=0.9.2
|
|
13
|
+
setuptools~=65.5.1
|
|
14
|
+
tinydb~=4.8.0
|
|
15
|
+
Pillow~=10.3.0
|