一个用于从种⼦标题中解析电影、剧集信息的 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-NTC"
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', ....}
解析副标题
TorSubtitle 用于从 PT 站的种⼦副标题中提取可能是标题的信息(这里叫extitle),以及season, episode等。
from tortitle import TorSubtitle
torrent_name = "舌尖上的中国 第一季 | 全7集 | 导演: 陈晓卿 | 主演: 李立宏 国语/中字 4K高码版"
subtitle = TorSubtitle(torrent_name)
print(f"副标题: {subtitle.extitle}")
print(f"季: {subtitle.season}")
print(f"集: {subtitle.episode}")
Contribution
欢迎提交 Pull Request
License
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.1.16.tar.gz
(26.8 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
tortitle-0.1.16-py3-none-any.whl
(12.9 kB
view details)
File details
Details for the file tortitle-0.1.16.tar.gz.
File metadata
- Download URL: tortitle-0.1.16.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e25c359ba319432d6619725a4b7b8c734c8250d38d2d0f4277b299e1d029cff7
|
|
| MD5 |
c197f4e93b615f24ed3515486a20b85e
|
|
| BLAKE2b-256 |
5144fb22781803790f8bb1038584ba8df1da9c7df66a9a9dbb9ad28ceea8a410
|
File details
Details for the file tortitle-0.1.16-py3-none-any.whl.
File metadata
- Download URL: tortitle-0.1.16-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d2e51e85049cecbb8522c3b1093a93e3c09b681047588079091e1cff719c527
|
|
| MD5 |
046327d43111d83fd2a249871c851a97
|
|
| BLAKE2b-256 |
ad1b96e6d9f2fd5751ca8c26f28286e5a214e4e56f8bf1755d98c9f7c1e79f34
|