PHPackages                             cwhite92/scene-release-parser-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. cwhite92/scene-release-parser-php

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

cwhite92/scene-release-parser-php
=================================

v2.0.0(7y ago)013MITPHP

Since Sep 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/cwhite92/scene-release-parser-php)[ Packagist](https://packagist.org/packages/cwhite92/scene-release-parser-php)[ RSS](/packages/cwhite92-scene-release-parser-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Scene Release Parser
====================

[](#scene-release-parser)

[![Build Status](https://camo.githubusercontent.com/67afef8a8795aafca2f9e34440dd110aa9a95a2d0398aafa3ef7b38a7535eb46/68747470733a2f2f7472617669732d63692e6f72672f7468636f6c696e2f7363656e652d72656c656173652d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thcolin/scene-release-parser)[![Code Climate](https://camo.githubusercontent.com/358e1331e1d12b85e29e5d53f897e126d98386ea8a90c40a7be157bd48ef2739/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7468636f6c696e2f7363656e652d72656c656173652d7061727365722f6261646765732f6770612e737667)](https://codeclimate.com/github/thcolin/scene-release-parser)[![Test Coverage](https://camo.githubusercontent.com/faa0940ce617815d43c16ff91c5594e2da16babe7de5515b9b424ba6e6f754db/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7468636f6c696e2f7363656e652d72656c656173652d7061727365722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/thcolin/scene-release-parser/coverage)

PHP Library parsing a scene release name to retrieve title and tags (original from [majestixx/scene-release-parser-php-lib](https://github.com/majestixx/scene-release-parser-php-lib)).

The library is made of one class : `thcolin\SceneReleaseParser\Release`, the constructor will try to extract all the tags from the release name and creates `getters` for each one, remaining parts will construct the title of the media (movie or tv show).

Installation
------------

[](#installation)

Install with composer :

```
composer require thcolin/scene-release-parser dev-master

```

Release Example :
-----------------

[](#release-example-)

Easiest way to start using the lib is to instantiating a new `Release` object with a scene release name as first argument, it will retrieve all the tags and the name :

```
use thcolin\SceneReleaseParser\Release;

// Optionals arguments
$strict = true; // if no tags found, it will throw an exception
$defaults = []; // defaults values for : language, resolution and year

$Release = new Release("Mr.Robot.S01E05.PROPER.VOSTFR.720p.WEB-DL.DD5.1.H264-ARK01", $strict, $defaults);

// TYPE
echo($Release -> getType()); // tvshow (::TVSHOW)

// TITLE
echo($Release -> getTitle()); // Mr Robot

// LANGUAGE
echo($Release -> getLanguage()); // VOSTFR

// YEAR
echo($Release -> getYear()); // null (no tag in the release name)
echo($Release -> guessYear()); // 2015 (year of the system)
echo($Release -> guess() -> getYear()); // 2015 (year of the system)

// RESOLUTION
echo($Release -> getResolution()); // 720p

// SOURCE
echo($Release -> getSource()); // WEB

// DUB
echo($Release -> getDub()); // null (no tag in the release name)

// ENCODING
echo($Release -> getEncoding()); // h264

// GROUP
echo($Release -> getGroup()); // ARK01

// FLAGS
print_r($Release -> getFlags()); // [PROPER, DD5.1]

// SCORE
echo($Release -> getScore()); // 7 (bigger is better, max : 7)

// ONLY TVSHOW
echo($Release -> getSeason()); // 1
echo($Release -> getEpisode()); // 5
```

Guess
-----

[](#guess)

Unknown informations of a current `Release` can be guessed :

```
use thcolin\SceneReleaseParser\Release;

$Release = new Release("Bataille a Seattle BDRip", false, [
  'language' => 'FRENCH' // default to Release::LANGUAGE_DEFAULT (VO)
]);

// LANGUAGE
echo($Release -> getLanguage()); // null
echo($Release -> guessLanguage()); // FRENCH

// RESOLUTION
echo($Release -> getResolution()); // null
echo($Release -> guessResolution()); // SD

// YEAR
echo($Release -> getYear()); // null
echo($Release -> guessYear()); // 2017 (current year)

// Will set guessed values to the Release
$Release -> guess();

// LANGUAGE
echo($Release -> getLanguage()); // FRENCH

// RESOLUTION
echo($Release -> getResolution()); // SD

// YEAR
echo($Release -> getYear()); // 2017 (current year)
```

Analyze
-------

[](#analyze)

For best results, you can directly analyze a `file`, the method will use `mediainfo` :

```
use thcolin\SceneReleaseParser\Release;

// Mhor\MediaInfo::setConfig arguments (default to empty)
$mediainfo = [
  // Optional, just for example
  'command' => '/usr/local/bin/mediainfo'
];

$Release = Release::analyze('/home/downloads/Bataille a Seattle BDRip.avi', $mediainfo);

// RELEASE
echo($Release -> getRelease(Release::GENERATED_RELEASE)): // Bataille.A.Seattle.FRENCH.720p.BDRip.x264-NOTEAM

// RESOLUTION
echo($Release -> getResolution()); // 720p

// ENCODING
echo($Release -> getEncoding()); // x264

// LANGUAGE
echo($Release -> getLanguage()); // FRENCH
```

Bin
---

[](#bin)

Inside `bin` folder, you got a `scene-release-renamer` executable, which require a `` argument (default to current working directory). It will scan ``, searching for video files (avi, mp4, mkv, mov) and folders to rename (if dirty) with valid generated scene release name. Scene release name will be constructed with current file name and `mediainfo` parsed informations (if available). If errors comes up, you'll be able to fix them manually.

### Usage

[](#usage)

```
php bin/scene-release-renamer  [--non-verbose] [--non-interactive] [--non-invasive] [--mediainfo=/usr/local/bin/mediainfo] [--default-(language|resolution|year)=value]

```

Results :
---------

[](#results-)

OriginalGeneratedBenjamin Button \[x264\] \[HD 720p\] \[LUCN\] \[FR\].mp4Benjamin.Button.FRENCH.720p.HDRip.x264-NOTEAM.mp4Jamais entre amis (2015) \[1080p\] MULTI (VFQ-VOA) Bluray x264 AC3-PopHD (Sleeping with Other People).mkvJamais.Entre.Amis.2015.MULTI.1080p.BLURAY.x264.AC3-PopHD.mkvLa Vie rêvée de Walter Mitty \[1080p\] MULTi 2013 BluRay x264-Pop (The Secret Life Of Walter Mitty) .mkvLa.Vie.Rêvée.De.Walter.Mitty.2013.MULTI.1080p.BLURAY.x264-Pop.mkvLe Nouveau Stagiaire (2015) The Intern - Multi 1080p - x264 AAC 5.1 - CCATS.mkvLe.Nouveau.Stagiaire.2015.MULTI.1080p.x264-CCATS.mkvLe prestige (2006) (The Prestige) 720p x264 AAC 5.1 MULTI \[NOEX\].mkvLe.Prestige.2006.MULTI.720p.x264-NOTEAM.mkvLes 4 Fantastiques 2015 Truefrench 720p x264 AAC PIXEL.mp4Les.4.Fantastiques.2015.TRUEFRENCH.720p.x264-NOTEAM.mp4One.For.the.Money.2012.1080p.HDrip.French.x264 (by kimo).mkvOne.For.The.Money.2012.FRENCH.1080p.HDRip.x264-NOTEAM.mkvTower Heist \[1080p\] MULTI 2011 BluRay x264-Pop .Le casse De Central Park. .mkvTower.Heist.2011.MULTI.1080p.BLURAY.x264-Pop.mkvTests
-----

[](#tests)

Use PHPUnit, there is a script to generate the json data for the tests in the folder `/utils`, it will take the release names from the `releases.txt` file in the same folder. Use it to generate the data needed for the tests, but before testing, make sure all the datas generated are valid, if not this would be useless.

Bugs
----

[](#bugs)

OriginalGeneratedThe Shawshank Redemption (1994) MULTi (VFQ-VO-VFF) 1080p BluRay x264-PopHD (Les Évadés)The.Shawshank.1994.MULTI.1080p.BLURAY.x264-NOTEAMLa ligne Verte (1999) MULTi-VF2 \[1080p\] BluRay x264-PopHD (The Green Mile)La.Ligne.1999.MULTI.1080p.BLURAY.x264-PopHDTODO
----

[](#todo)

- `Release->guessResolution()` should consider `$Release->source`
- Add `Release::LANGUAGE_*` constants
    - Use them in `ReleaseTest`
    - And `README ## Guess`
- Add `boolean $flags` for `Release::__toString`
    - implement option in `Release::getRelease` too
    - if `true` will add `Release->flags` to generated release name
- Resolve CodeCoverage issues

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 93.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2811d ago

Major Versions

v1.0.0 → v2.0.02018-09-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a30b69accb959bc41d11290e5b8d803ddf115d3002f53a3148c0788abb5e11b?d=identicon)[cwhite92](/maintainers/cwhite92)

---

Top Contributors

[![thcolin](https://avatars.githubusercontent.com/u/9131757?v=4)](https://github.com/thcolin "thcolin (57 commits)")[![TobiasHeide](https://avatars.githubusercontent.com/u/96474322?v=4)](https://github.com/TobiasHeide "TobiasHeide (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cwhite92-scene-release-parser-php/health.svg)

```
[![Health](https://phpackages.com/badges/cwhite92-scene-release-parser-php/health.svg)](https://phpackages.com/packages/cwhite92-scene-release-parser-php)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
