Skip to main content

A regex-based Python library to parse scene release names and extract technical metadata

Project description

Releascenify

Releascenify Logo

PyPI version Tests status

Parse Scene and P2P release names into structured metadata and compare release quality automatically. Built with a rule/regex engine.

Live Demo: https://dmachard.github.io/releascenify/docs/

Why?

Release names follow a strict grammar inherited from the Scene and P2P groups. Once decoded, you can predict the quality, source, language, and release group just from the filename. This library is an alternative to PTN (Parse Torrent Name).

Installation

pip install releascenify

Usage

from releascenify import parse_filename
from releascenify.comparator import get_quality_score, is_better_release

filename = "Gladiator.II.2024.MULTi.2160p.WEB-DL.DV.HDR.H265-GROUP"
parsed = parse_filename(filename)

print(parsed)
# {
#   "title": "Gladiator II",
#   "year": 2024,
#   "resolution": "2160P",
#   "quality": "WEB-DL",
#   "v_quality": "HDR DV",
#   "codec": "H265",
#   "languages": ["MULTI"]
#   ...
# }

# Calculate quality score
score = get_quality_score(parsed)
print(f"Quality Score: {score}")

# Compare two releases
rel_a = parse_filename("Gladiator.II.2024.1080p.BluRay.x264-GROUP")
rel_b = parse_filename("Gladiator.II.2024.2160p.WEB-DL.x265-GROUP")

if is_better_release(rel_b, rel_a):
    print("Release B is better than Release A")

Quality Scoring

For details on how files are rated, scoring weights, and priority factors, see SCORING.md.

Expected Tags & Normalization

Here are the metadata fields extracted by releascenify and how their values are normalized:

Video Codecs (codec)

To make release metadata processing and quality comparison consistent, the parser normalizes various representations of codecs:

  • H265: Normalized from inputs containing H265, x265, HEVC (including variants with dots or hyphens like H.265 or H-265).
  • H264: Normalized from inputs containing H264, x264, AVC (including variants with dots or hyphens like H.264 or H-264).
  • VC-1: Normalized from inputs containing VC1 or VC-1.

Resolutions (resolution)

To keep resolution metadata consistent, they are normalized to standard keys:

  • 2160P: Normalized from inputs containing 2160p, 2160P, 4K, or UHD.
  • 1080P: Normalized from inputs containing 1080p or 1080P.
  • 720P: Normalized from inputs containing 720p or 720P.
  • 4KLIGHT: Extracted from inputs containing 4KLIGHT.

Source Quality (quality)

The source tags are normalized to standard quality keys:

  • WEB-DL: Normalized from inputs containing WEB-DL, WEBDL, or WEB.
  • WEBRIP: Extracted from inputs containing WEBRip or WEBRIP.
  • BLURAY: Extracted from BLURAY, BDRIP, or BRRIP.
  • REMUX / DVDRIP / HDTV / WEBLIGHT

Audio Codecs (audio)

To keep audio metadata consistent, standard audio codecs are normalized as follows:

  • EAC3: Normalized from inputs containing EAC3, E-AC3, DDP, DDP2.0, DDP5.1, DDP7.1, etc. (Dolby Digital Plus).
  • DTS-HD MA: Normalized from inputs containing DTS-HD MA, DTSHDMA, DTS-HD.MA, DTS-HD-MA, DTS-HD_MA, etc. (DTS-HD Master Audio).
  • DTS-HD: Normalized from inputs containing DTS-HD, DTS.HD, DTS_HD, DTS HD, DTSHD, etc. when the Master Audio suffix is not present.
  • Other standard codecs extracted: TRUEHD / DTS / AC3 / AAC / FLAC / MP3.
  • Note: If ATMOS is present, it is appended to the base codec (e.g., EAC3 ATMOS, TRUEHD ATMOS, DTS-HD MA ATMOS). If only Atmos is present, it will be ATMOS.

Audio Channels (channels)

  • Standard channel counts: 7.1 / 5.1 / 2.1 / 2.0 / 1.0 (mono).

Video Enhancements (v_quality)

  • HDR / HDR10 / HDR10+ / DV (Dolby Vision) / HLG / SDR / 10BIT / 12BIT

Languages (languages)

  • Lists of extracted language tags: VFF (TrueFrench) / FRENCH / VF / VF2 / VFI / VFQ / VOSTFR / FASTSUB / EN / VO / MULTI

Network/Platform (network)

  • Stream/broadcast platform names normalized:
    • Netflix (from NF)
    • Amazon Prime (from AMZN, AMAZON STUDIOS, AMAZON PRIME)
    • Disney+ (from DSNP, DSNY, DISNEY PLUS)
    • Apple TV+ (from ATV, APPLE TV PLUS)
    • HBO Max / HBO (from HMAX, HBO MAX, HBO)
    • Hulu (from HULU)
    • Paramount+ (from PARAMOUNT PLUS)

Special Tags (extra)

  • Extracted modifiers: REPACK / PROPER / FINAL / INTERNAL / CUSTOM.

Development & Tests

Setup Local Virtual Environment

To set up the development environment, create a virtual environment and install the package in editable mode with development dependencies:

virtualenv .venv
source .venv/bin/activate

Run Tests

Run the test suite using pytest:

pytest tests/ -v

Run Website Locally

You need to run a local web server from the repository root:

# Start a local HTTP server
python3 -m http.server 8000

Then navigate to: http://localhost:8000/ (which redirects to /docs/) or directly to http://localhost:8000/docs/.

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

releascenify-0.19.0.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

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

releascenify-0.19.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file releascenify-0.19.0.tar.gz.

File metadata

  • Download URL: releascenify-0.19.0.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for releascenify-0.19.0.tar.gz
Algorithm Hash digest
SHA256 555ed4a3ff49a3f0deb0eafc9a1f7e8042ea6378a44bd0d93e206d9a5d623ccd
MD5 987fb6addec5abd92ec604adbbdbdeac
BLAKE2b-256 8e9568a74f1f3ed929fc6cc35fec08607e3a83801a49b8355f515adbad853cf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for releascenify-0.19.0.tar.gz:

Publisher: publish.yml on dmachard/ReleascenIFY

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file releascenify-0.19.0-py3-none-any.whl.

File metadata

  • Download URL: releascenify-0.19.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for releascenify-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b071aa9435b79959e47c8a0c7b1e13a96148160180f14fa8b22268e4bf231b14
MD5 7a5946670d80964f08d8283f8b931d14
BLAKE2b-256 f07469d2531ac3ef9bbce0e18a64c564d24f653826653cd950b391b0be5773b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for releascenify-0.19.0-py3-none-any.whl:

Publisher: publish.yml on dmachard/ReleascenIFY

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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