mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-04 14:45:26 +08:00
完善修正功能
This commit is contained in:
16
README.md
16
README.md
@@ -7,18 +7,26 @@
|
||||
```bash
|
||||
pip install qbittorrent-api
|
||||
```
|
||||
|
||||
## 使用之前
|
||||
在 `config.json` 中填入你的 `hostip` `username` `password` `savepath`:
|
||||
```json
|
||||
{
|
||||
"host_ip": "192.168.31.10:8181",
|
||||
"username": "admin",
|
||||
"password": "adminadmin",
|
||||
"savepath": "/downloads/Bangumi"
|
||||
}
|
||||
```
|
||||
## 自动下载规则建立
|
||||
```shell
|
||||
python3 rule_set.py --name <新番名称>
|
||||
```
|
||||
|
||||
# 不符合规则的番剧重命名
|
||||
## 使用之前
|
||||
在 `config.json` 中填入你的 `hostip` `username` `password` `savepath`。
|
||||
|
||||
## rename_qb
|
||||
```shell
|
||||
python3 rename_qb --help
|
||||
python3 rename_qb.py --help
|
||||
```
|
||||
目前有三种重命名模式
|
||||
- `--method normal`: 普通模式,直接重命名,保留番剧字幕组信息。
|
||||
|
||||
26
test.py
26
test.py
@@ -1,26 +0,0 @@
|
||||
import re
|
||||
import os
|
||||
|
||||
file_name = '[Sakurato] Machikado Mazoku 2-choume [06][AVC-8bit 1080P AAC][CHS]'
|
||||
episode_rules = [r'(.*)\[(\d{1,3}|\d{1,3}\.\d{1,2})(?:v\d{1,2})?(?:END)?\](.*)',
|
||||
r'(.*)\[E(\d{1,3}|\d{1,3}\.\d{1,2})(?:v\d{1,2})?(?:END)?\](.*)',
|
||||
r'(.*)\[第(\d*\.*\d*)话(?:END)?\](.*)',
|
||||
r'(.*)\[第(\d*\.*\d*)話(?:END)?\](.*)',
|
||||
r'(.*)第(\d*\.*\d*)话(?:END)?(.*)',
|
||||
r'(.*)第(\d*\.*\d*)話(?:END)?(.*)',
|
||||
r'(.*)- (\d{1,3}|\d{1,3}\.\d{1,2})(?:v\d{1,2})?(?:END)? (.*)']
|
||||
|
||||
|
||||
def new_name(name):
|
||||
n = re.split(r'\[|\]', name)
|
||||
file_name = name.replace(f'[{n[1]}]', '')
|
||||
for rule in episode_rules:
|
||||
matchObj = re.match(rule, file_name, re.I)
|
||||
if matchObj is not None:
|
||||
new_name = f'{matchObj.group(1)}E{matchObj.group(2)} {matchObj.group(3)}'
|
||||
return new_name
|
||||
|
||||
|
||||
print(new_name(file_name))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user