Skip to main content

一个用于从种⼦标题中解析电影、剧集信息的 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

MIT

Project details


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.3.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tortitle-0.1.3-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file tortitle-0.1.3.tar.gz.

File metadata

  • Download URL: tortitle-0.1.3.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tortitle-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f62be86c8359f7e159596e6f1da2ecc695327487c0df3e699b517dae5f962ad2
MD5 8b8d02b73e1bc2cd9bc49d6a37ad1d6e
BLAKE2b-256 b1fcae8cd95311fad300f222ac2e146b6fe40ad1bffb5b0c2ccbf3a5f7213b26

See more details on using hashes here.

File details

Details for the file tortitle-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tortitle-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tortitle-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1e4986a3171feac98860bfa9e1dab1e2a783f42556642adb2725c36959aa0d0b
MD5 ebb0c8333e837f862590d84c73f4556d
BLAKE2b-256 4863b8aa0454c41a52c6c8015fc8e0859c4ccdb103526da38ffed43562d0b15f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page