一个用于从种⼦标题中解析电影、剧集信息的 Python 库,支持主标题和副标题的提取。
Project description
TorTitle
一个用于从种⼦标题中解析电影、剧集信息的 Python 库,支持主标题和副标题的提取。
安装
pip install tortitle
使用方法
解析主标题
TorTitle 类用于解析种⼦标题,并提取主要信息,例如标题、年份、季数、集数、分辨率等。
from tortitle import TorTitle
torrent_name = "The.Mandalorian.S01E01.1080p.WEB-DL.DDP5.1.H.264-NT"
title = TorTitle(torrent_name)
print(f"标题: {title.title}")
print(f"中文标题: {title.cntitle}")
print(f"年份: {title.year}")
print(f"季: {title.season}")
print(f"集: {title.episode}")
print(f"分辨率: {title.resolution}")
print(f"片源: {title.media_source}")
print(f"制作组: {title.group}")
# another example
torrent_name = "[美国][金钱世界][All.the.Money.in.the.World.2017.1080p.BluRay.x264.DTS.5.1-CMCC][中英字幕]"
print(TorTitle(torrent_name).to_dict())
# 输出:
# {'title': 'All the Money in the World', 'cntitle': '金钱世界', 'year': '2017', 'type': 'movie', 'season': '', 'episode': ''}
解析副标题
TorSubtitle 类用于从 PT 站的种⼦标题中提取副标题信息。
from tortitle import TorSubtitle
torrent_name = "舌尖上的中国 第一季 | 全7集 | 导演: 陈晓卿 | 主演: 李立宏 国语/中字 4K高码版"
subtitle = TorSubtitle(torrent_name)
print(f"副标题: {subtitle.extitle}")
print(f"季: {subtitle.season}")
print(f"集: {subtitle.episode}")
贡献
欢迎提交 Pull Request。对于重大更改,请先开一个 issue 进行讨论。
许可证
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tortitle-0.0.4.tar.gz
(16.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tortitle-0.0.4.tar.gz.
File metadata
- Download URL: tortitle-0.0.4.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5ef143a9834d5b82f2ccf9d65c08fb8f717a99f7372e8abeb3f4e76976da166
|
|
| MD5 |
561d916f5670a9c5e622ae3172fbb1c8
|
|
| BLAKE2b-256 |
9072fd937a66213c0368e64377a945854d3a1ca030dfa5e287683fd48e7cc684
|
File details
Details for the file tortitle-0.0.4-py3-none-any.whl.
File metadata
- Download URL: tortitle-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c67429d0fd08393998bb13dd83474e5f6c4bf1f3a6d1563254f41115ce8c6368
|
|
| MD5 |
9f2c39849f6143afb6470cf2a9ecd223
|
|
| BLAKE2b-256 |
0cf43529c5eae7bebda08ecefceba2ae2cb55d69f112c251e9a97aae20e8a272
|