yema 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.
- yema-0.1.0/.gitignore +27 -0
- yema-0.1.0/PKG-INFO +163 -0
- yema-0.1.0/README.md +152 -0
- yema-0.1.0/pyproject.toml +34 -0
- yema-0.1.0/uv.lock +607 -0
- yema-0.1.0/yema/__init__.py +0 -0
- yema-0.1.0/yema/clients/__init__.py +0 -0
- yema-0.1.0/yema/clients/qbittorrent.py +299 -0
- yema-0.1.0/yema/clients/yemapt.py +286 -0
- yema-0.1.0/yema/commands/__init__.py +0 -0
- yema-0.1.0/yema/commands/qb.py +366 -0
- yema-0.1.0/yema/config/__init__.py +36 -0
- yema-0.1.0/yema/config/debug.py +26 -0
- yema-0.1.0/yema/config/qb.py +22 -0
- yema-0.1.0/yema/config/utils.py +108 -0
- yema-0.1.0/yema/config/yemapt.py +26 -0
- yema-0.1.0/yema/core/__init__.py +0 -0
- yema-0.1.0/yema/core/debug.py +150 -0
- yema-0.1.0/yema/core/formatting.py +159 -0
- yema-0.1.0/yema/core/terminal.py +47 -0
- yema-0.1.0/yema/domain/__init__.py +0 -0
- yema-0.1.0/yema/domain/trackers.py +94 -0
- yema-0.1.0/yema/init.py +242 -0
- yema-0.1.0/yema/main.py +60 -0
- yema-0.1.0/yema/qb.py +20 -0
- yema-0.1.0/yema/services/__init__.py +0 -0
- yema-0.1.0/yema/services/torrents.py +351 -0
- yema-0.1.0/yema/storage/__init__.py +0 -0
- yema-0.1.0/yema/storage/cache.py +238 -0
- yema-0.1.0/yema/tracker_map.py +11 -0
- yema-0.1.0/yema/ui/__init__.py +0 -0
- yema-0.1.0/yema/ui/screens.py +363 -0
yema-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
.python-version
|
|
3
|
+
|
|
4
|
+
.venv/
|
|
5
|
+
venv/
|
|
6
|
+
env/
|
|
7
|
+
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
.ruff_cache/
|
|
15
|
+
.coverage
|
|
16
|
+
.coverage.*
|
|
17
|
+
htmlcov/
|
|
18
|
+
|
|
19
|
+
build/
|
|
20
|
+
dist/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
|
|
23
|
+
tmp/
|
|
24
|
+
*.tmp
|
|
25
|
+
*.torrent
|
|
26
|
+
|
|
27
|
+
.yema/
|
yema-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yema
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: yemapt/qBittorrent helper for seeding and torrent checks
|
|
5
|
+
Author-email: mustangpt <admin@yemapt.org>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: typer>=0.9.0
|
|
9
|
+
Requires-Dist: wcwidth>=0.2.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# yema
|
|
13
|
+
|
|
14
|
+
`yema` 是一个面向 yemapt 和 qBittorrent 的命令行辅助工具,用来管理保种、检查站点收录情况,并辅助半自动转种。
|
|
15
|
+
|
|
16
|
+
## 功能
|
|
17
|
+
|
|
18
|
+
- 配置 yemapt `auth` 和 qBittorrent Web API 登录信息。
|
|
19
|
+
- 查看 qBittorrent 中的种子列表和种子详情。
|
|
20
|
+
- 基于 Pieces Hash 查找 qBittorrent 中内容完全相同的重复种子。
|
|
21
|
+
- 检查 qBittorrent 中的种子是否已经被 yemapt 收录。
|
|
22
|
+
- 显示已收录种子的 yemapt 种子 ID 和当前做种状态。
|
|
23
|
+
- 辅助补种:对已被 yemapt 收录但当前用户未做种的项目,下载新种并添加到 qBittorrent。
|
|
24
|
+
- 辅助转种:列出 qBittorrent 中尚未被 yemapt 收录的种子,并尽量展示来源站点详情页。
|
|
25
|
+
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
从 PyPI 安装:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install yema
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
如果使用 `uv`:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uv tool install yema
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
源码运行:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone <repo-url>
|
|
44
|
+
cd yema
|
|
45
|
+
uv sync
|
|
46
|
+
uv run yema --help
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 初始化
|
|
50
|
+
|
|
51
|
+
首次使用建议运行交互式初始化:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
yema init
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
初始化会依次配置:
|
|
58
|
+
|
|
59
|
+
- yemapt auth
|
|
60
|
+
- qBittorrent Web API 地址、用户名和密码
|
|
61
|
+
|
|
62
|
+
配置会保存到:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
~/.yema/setting.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
也可以用命令单独配置:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
yema config yemapt --auth "YOUR_YEMAPT_AUTH"
|
|
72
|
+
yema config qb --host "http://127.0.0.1:8080" --username "qbuser" --password "qbpass"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
查看当前配置:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
yema config
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 常用命令
|
|
82
|
+
|
|
83
|
+
进入 qBittorrent 操作菜单:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
yema qb
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
菜单中支持:
|
|
90
|
+
|
|
91
|
+
- `list`:查看 qBittorrent 当前种子列表。
|
|
92
|
+
- `pieces_dedup`:按 Pieces Hash 查找重复内容。
|
|
93
|
+
|
|
94
|
+
检查 qBittorrent 种子是否已被 yemapt 收录:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
yema check
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
辅助保种:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
yema seed
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`seed` 会分析 qBittorrent 中的种子,找出已被 yemapt 收录但当前用户未做种的项目。执行前会逐个确认,不会自动批量修改。
|
|
107
|
+
|
|
108
|
+
辅助转种:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
yema pub
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`pub` 会列出 qBittorrent 中尚未被 yemapt 收录的种子,并显示 tracker 来源。对于部分站点,工具会尝试解析并展示详情页 URL,方便手动转种。
|
|
115
|
+
|
|
116
|
+
## Debug
|
|
117
|
+
|
|
118
|
+
启用 debug:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
yema config debug enable
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
关闭 debug:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
yema config debug disable
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
debug 模式会输出 qBittorrent 和 yemapt 请求过程,适合排查登录失败、接口失败、下载种子失败等问题。较长的响应内容会写入当前目录的 `tmp/` 下。
|
|
131
|
+
|
|
132
|
+
## 缓存
|
|
133
|
+
|
|
134
|
+
工具会在 `~/.yema/` 下保存本地缓存,用于减少重复请求:
|
|
135
|
+
|
|
136
|
+
- qBittorrent 种子的 Pieces Hash
|
|
137
|
+
- tracker 信息
|
|
138
|
+
- yemapt Pieces Hash 查询结果
|
|
139
|
+
|
|
140
|
+
如果发现结果明显不符合预期,可以删除 `~/.yema/` 下对应缓存文件后重试。
|
|
141
|
+
|
|
142
|
+
## 注意事项
|
|
143
|
+
|
|
144
|
+
- 需要先启用 qBittorrent Web UI,并确保当前机器可以访问 Web API。
|
|
145
|
+
- `seed` 添加新种时会使用原 qBittorrent 种子的保存路径,并开启跳过校验添加。
|
|
146
|
+
- 替换已有非当前用户 yemapt 做种时,工具只删除 qBittorrent 中的旧任务,不删除本地文件。
|
|
147
|
+
- `pub` 只是辅助列出未收录种子,不会自动发布到 yemapt。
|
|
148
|
+
|
|
149
|
+
## 配置示例
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"yemapt": {
|
|
154
|
+
"auth": "YOUR_YEMAPT_AUTH"
|
|
155
|
+
},
|
|
156
|
+
"qb": {
|
|
157
|
+
"host": "http://127.0.0.1:8080",
|
|
158
|
+
"username": "qbuser",
|
|
159
|
+
"password": "qbpass"
|
|
160
|
+
},
|
|
161
|
+
"debug": false
|
|
162
|
+
}
|
|
163
|
+
```
|
yema-0.1.0/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# yema
|
|
2
|
+
|
|
3
|
+
`yema` 是一个面向 yemapt 和 qBittorrent 的命令行辅助工具,用来管理保种、检查站点收录情况,并辅助半自动转种。
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- 配置 yemapt `auth` 和 qBittorrent Web API 登录信息。
|
|
8
|
+
- 查看 qBittorrent 中的种子列表和种子详情。
|
|
9
|
+
- 基于 Pieces Hash 查找 qBittorrent 中内容完全相同的重复种子。
|
|
10
|
+
- 检查 qBittorrent 中的种子是否已经被 yemapt 收录。
|
|
11
|
+
- 显示已收录种子的 yemapt 种子 ID 和当前做种状态。
|
|
12
|
+
- 辅助补种:对已被 yemapt 收录但当前用户未做种的项目,下载新种并添加到 qBittorrent。
|
|
13
|
+
- 辅助转种:列出 qBittorrent 中尚未被 yemapt 收录的种子,并尽量展示来源站点详情页。
|
|
14
|
+
|
|
15
|
+
## 安装
|
|
16
|
+
|
|
17
|
+
从 PyPI 安装:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install yema
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
如果使用 `uv`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
uv tool install yema
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
源码运行:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone <repo-url>
|
|
33
|
+
cd yema
|
|
34
|
+
uv sync
|
|
35
|
+
uv run yema --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 初始化
|
|
39
|
+
|
|
40
|
+
首次使用建议运行交互式初始化:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
yema init
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
初始化会依次配置:
|
|
47
|
+
|
|
48
|
+
- yemapt auth
|
|
49
|
+
- qBittorrent Web API 地址、用户名和密码
|
|
50
|
+
|
|
51
|
+
配置会保存到:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
~/.yema/setting.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
也可以用命令单独配置:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
yema config yemapt --auth "YOUR_YEMAPT_AUTH"
|
|
61
|
+
yema config qb --host "http://127.0.0.1:8080" --username "qbuser" --password "qbpass"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
查看当前配置:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
yema config
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 常用命令
|
|
71
|
+
|
|
72
|
+
进入 qBittorrent 操作菜单:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
yema qb
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
菜单中支持:
|
|
79
|
+
|
|
80
|
+
- `list`:查看 qBittorrent 当前种子列表。
|
|
81
|
+
- `pieces_dedup`:按 Pieces Hash 查找重复内容。
|
|
82
|
+
|
|
83
|
+
检查 qBittorrent 种子是否已被 yemapt 收录:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
yema check
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
辅助保种:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
yema seed
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`seed` 会分析 qBittorrent 中的种子,找出已被 yemapt 收录但当前用户未做种的项目。执行前会逐个确认,不会自动批量修改。
|
|
96
|
+
|
|
97
|
+
辅助转种:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
yema pub
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`pub` 会列出 qBittorrent 中尚未被 yemapt 收录的种子,并显示 tracker 来源。对于部分站点,工具会尝试解析并展示详情页 URL,方便手动转种。
|
|
104
|
+
|
|
105
|
+
## Debug
|
|
106
|
+
|
|
107
|
+
启用 debug:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
yema config debug enable
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
关闭 debug:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
yema config debug disable
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
debug 模式会输出 qBittorrent 和 yemapt 请求过程,适合排查登录失败、接口失败、下载种子失败等问题。较长的响应内容会写入当前目录的 `tmp/` 下。
|
|
120
|
+
|
|
121
|
+
## 缓存
|
|
122
|
+
|
|
123
|
+
工具会在 `~/.yema/` 下保存本地缓存,用于减少重复请求:
|
|
124
|
+
|
|
125
|
+
- qBittorrent 种子的 Pieces Hash
|
|
126
|
+
- tracker 信息
|
|
127
|
+
- yemapt Pieces Hash 查询结果
|
|
128
|
+
|
|
129
|
+
如果发现结果明显不符合预期,可以删除 `~/.yema/` 下对应缓存文件后重试。
|
|
130
|
+
|
|
131
|
+
## 注意事项
|
|
132
|
+
|
|
133
|
+
- 需要先启用 qBittorrent Web UI,并确保当前机器可以访问 Web API。
|
|
134
|
+
- `seed` 添加新种时会使用原 qBittorrent 种子的保存路径,并开启跳过校验添加。
|
|
135
|
+
- 替换已有非当前用户 yemapt 做种时,工具只删除 qBittorrent 中的旧任务,不删除本地文件。
|
|
136
|
+
- `pub` 只是辅助列出未收录种子,不会自动发布到 yemapt。
|
|
137
|
+
|
|
138
|
+
## 配置示例
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"yemapt": {
|
|
143
|
+
"auth": "YOUR_YEMAPT_AUTH"
|
|
144
|
+
},
|
|
145
|
+
"qb": {
|
|
146
|
+
"host": "http://127.0.0.1:8080",
|
|
147
|
+
"username": "qbuser",
|
|
148
|
+
"password": "qbpass"
|
|
149
|
+
},
|
|
150
|
+
"debug": false
|
|
151
|
+
}
|
|
152
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "yema"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "yemapt/qBittorrent helper for seeding and torrent checks"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "mustangpt", email = "admin@yemapt.org" }
|
|
10
|
+
]
|
|
11
|
+
dependencies = [
|
|
12
|
+
"typer>=0.9.0",
|
|
13
|
+
"wcwidth>=0.2.6",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[project.scripts]
|
|
17
|
+
yema = "yema.main:main"
|
|
18
|
+
|
|
19
|
+
[build-system]
|
|
20
|
+
requires = ["hatchling>=1.16.0"]
|
|
21
|
+
build-backend = "hatchling.build"
|
|
22
|
+
|
|
23
|
+
[tool.uv]
|
|
24
|
+
# uv 会自动识别 pyproject.toml 中的项目依赖。
|
|
25
|
+
# 这里可以添加 uv 特定配置,例如运行环境、锁文件位置等。
|
|
26
|
+
|
|
27
|
+
[tool.hatch.build.targets.wheel]
|
|
28
|
+
packages = ["yema"]
|
|
29
|
+
|
|
30
|
+
[dependency-groups]
|
|
31
|
+
dev = [
|
|
32
|
+
"build>=1.5.0",
|
|
33
|
+
"twine>=6.2.0",
|
|
34
|
+
]
|