PHPackages                             hsnfirdaus/subscene-sdk - 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. hsnfirdaus/subscene-sdk

AbandonedArchivedLibrary

hsnfirdaus/subscene-sdk
=======================

A unofficial subscene.com sdk to search, download, and smart filtering subtitle

v2.0(5y ago)139Apache-2.0PHP

Since Sep 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hsnfirdaus/subscene-sdk)[ Packagist](https://packagist.org/packages/hsnfirdaus/subscene-sdk)[ RSS](/packages/hsnfirdaus-subscene-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

Subscene SDK
============

[](#subscene-sdk)

A php library to getting the subtitle data and files from subscene.com website with smart filter.

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

[](#installation)

### Using Composer

[](#using-composer)

It's recomended to install this library by [Composer](https://getcomposer.org/) :

```
composer require "hsnfirdaus/subscene-sdk"

```

or you can just manually download this repository as zip and extract to your project directory.

### Notice

[](#notice)

If you are using the V1 of this library, please read the (README.v1.md)

Usage
=====

[](#usage)

Calling Class
-------------

[](#calling-class)

To begin, just require the autoloader of composer :

```
require __DIR__ . '/vendor/autoload.php';
```

or if you download this script manually, require the `/src/Subscene.php` file :

```
require __DIR__ . '/subscene-sdk/src/Subscene.php';
```

then you just call the Subscene class like this :

```
$subscene = new Hsnfirdaus\Subscene();

```

Getting Result
--------------

[](#getting-result)

This class support to get result as Array or JSON. Just call getArray() method or getJSON() method. All method will response three object/array : type,info, and result.

Error Handling
--------------

[](#error-handling)

You can use `try{ } catch() { }` Exception to handling error.

Exception NameDescription`CURLError`Something wrong with cURL`PageStructurError`Cannot match content from cURL Result, maybe subscene page structure has been changed.`FunctionError`Error when running method, maybe you wrong call the method.List Of Method
--------------

[](#list-of-method)

- **[search](#search)**
    - [Example Request](#example-request)
    - [Parameters](#parameters)
    - [Example Response](#example-response)
- **[listSubtitle](#listSubtitle)**
    - [Example Request](#example-request)
    - [Parameters](#parameters)
    - [Example Response](#example-response)
- **[getSubtitle](#getSubtitle)**
    - [Example Request](#example-request)
    - [Parameters](#parameters)
    - [Example Response](#example-response)
- **[smartFilterSeries](#smartFilterSeries)**
    - [Example Request](#example-request)
    - [Parameters](#parameters)
    - [Example Response](#example-response)
- **[smartDownloadSeries](#smartDownloadSeries)**
    - [Example Request](#example-request)
    - [Parameters](#parameters)
    - [Example Response](#example-response)

### Search

[](#search)

This method is using to search movie or series that subtitle is available in subscene.

#### Example Request

[](#example-request)

```
$subscene = new Hsnfirdaus\Subscene();
$search = $subscene->search($query);
print_r($search->getArray());
```

#### Parameters

[](#parameters)

ParameterTypeDefault ValueDetails`$query``string`nullThe title for movie/series that you want to search.#### Example Response

[](#example-response)

Example `$subscene->search('ncis')->getArray()` response :

```
Array
(
    [type] => SEARCH
    [info] => Array
        (
            [search_query] => ncis
        )

    [result] => Array
        (
            [0] => Array
                (
                    [permalink] => ncis-los-angeles-twelfth-season
                    [title] => NCIS: Los Angeles - Twelfth Season
                    [year] =>
                    [count] => 27
                    [in_heading] => TV-Series
                    [season] => 12
                )

            [1] => Array
                (
                    [permalink] => ncis-new-orleans-seventh-season
                    [title] => NCIS: New Orleans - Seventh Season
                    [year] =>
                    [count] => 11
                    [in_heading] => TV-Series
                    [season] => 7
                )

            [2] => Array
                (
                    [permalink] => ncis-eighteenth-season
                    [title] => NCIS: Naval Criminal Investigative Service (Navy CIS) - Eighteenth Season
                    [year] =>
                    [count] => 37
                    [in_heading] => TV-Series
                    [season] => 18
                )
        )

)
```

### listSubtitle

[](#listsubtitle)

This method is using to listing subtitle from specific permalink.

#### Example Request

[](#example-request-1)

```
$subscene = new Hsnfirdaus\Subscene();
$listSubtitle = $subscene->listSubtitle($permalink);
print_r($listSubtitle->getArray());
```

#### Parameters

[](#parameters-1)

ParameterTypeDefault ValueDetails`$permalink``string`nullThe permalink of page that you will looking for list subtitle.#### Example Response

[](#example-response-1)

Example `$subscene->listSubtitle('ncis-eighteenth-season')->getArray()` response :

```
Array
(
    [type] => LIST_SUBTITLE
    [info] => Array
        (
            [permalink] => ncis-eighteenth-season
            [title] => NCIS: Naval Criminal Investigative Service (Navy CIS) - Eighteenth Season
            [year] => 2020
            [poster] => https://i.jeded.com/i/ncis-eighteenth-season.196526.jpg
            [imdb_id] => tt0364845
        )

    [result] => Array
        (
            [0] => Array
                (
                    [id] => 2391386
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => positive
                    [name] => NCIS.S18E07.WEBRip.x264-ION10
                    [hearing_impaired] => 1
                    [user] => Array
                        (
                            [id] => 1068258
                            [name] => M_I_S
                        )

                    [comment] => Hi:WebRip/WebDl:Duration : 43 min 14 s&nbsp;
                )

            [1] => Array
                (
                    [id] => 2391385
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => positive
                    [name] => NCIS.S18E07.WEBRip.x264-ION10
                    [hearing_impaired] =>
                    [user] => Array
                        (
                            [id] => 1068258
                            [name] => M_I_S
                        )

                    [comment] => Non Hi:WebRip/WebDl:Duration : 43 min 14 s
&nbsp;
                )

            [2] => Array
                (
                    [id] => 2391412
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => neutral
                    [name] => NCIS.S18E07.The.First.Day.720p.AMZN.WEB-DL.DDP5.1.H.264-NTb
                    [hearing_impaired] =>
                    [user] => Array
                        (
                            [id] => 1358973
                            [name] => SoftSpotForBoobies
                        )

                    [comment] => A Amazon Original Subtitle &nbsp;
                )

            [3] => Array
                (
                    [id] => 2391412
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => neutral
                    [name] => NCIS.S18E07.The.First.Day.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb
                    [hearing_impaired] =>
                    [user] => Array
                        (
                            [id] => 1358973
                            [name] => SoftSpotForBoobies
                        )

                    [comment] => A Amazon Original Subtitle &nbsp;
                )

        )

)
```

### getSubtitle

[](#getsubtitle)

This method is using to generate download link and information of specific subtitle.

#### Example Request

[](#example-request-2)

```
$subscene = new Hsnfirdaus\Subscene();
$getSubtitle = $subscene->getSubtitle($permalink,$lang_code,$id)
print_r($getSubtitle->getArray());
```

#### Parameters

[](#parameters-2)

ParameterTypeDefault ValueDetails`$permalink``string`nullThe permalink of page that you will get the subtitle.`$lang_code``string`nullThe language code of subtitle.`$id``integer`nullThe id of subtitle.#### Example Response

[](#example-response-2)

Example `$subscene->getSubtitle('ncis-eighteenth-season','english',2391412)->getArray()` response :

```
Array
(
    [type] => GET_SUBTITLE
    [info] => Array
        (
            [permalink] => ncis-eighteenth-season
            [language] => Array
                (
                    [code] => english
                    [name] => English
                )

            [id] => 2391412
            [poster] => https://i.jeded.com/i/ncis-eighteenth-season.196526.jpg
            [title] => NCIS: Naval Criminal Investigative Service (Navy CIS) - Eighteenth Season
            [imdb_id] => tt0364845
            [release_list] => Array
                (
                    [0] => NCIS.S18E07.The.First.Day.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb
                    [1] => NCIS.S18E07.The.First.Day.720p.AMZN.WEB-DL.DDP5.1.H.264-NTb
                )

            [user] => Array
                (
                    [id] => 0
                    [name] => Anonymous
                )

            [comment] => A Amazon Original Subtitle
        )

    [result] => Array
        (
            [preview] => 100:00:05,135 --&gt; 00:00:08,269You know what 4:00 a.m.in February feels like, Ronnie?200:00:08,312 --&gt; 00:00:11,924And I&#39;m out here chasing a catin a coal mine.300:00:11,968 --&gt; 00:00:14,144RONNIE:All I do is take the info down,pass it along.400:00:14,188 --&gt; 00:00:17,234Well, next time, verify the GPS.500:00:17,278 --&gt; 00:00:20,759
            [details] => Array
                (
                    [online] => 2/10/2021 8:16 AM &nbsp; 1 days ago
                    [hearing_impaired] => No
                    [foreign_parts] => No
                    [framerate] => Not available
                    [files] => 1 (26,329 bytes)
                    [production_type] => From retail
                    [release_type] => Web
                    [ratings] => Array
                        (
                            [score] => 0
                            [of] => 0
                            [total_user] => 0
                        )

                    [total_download] => 156
                )

            [download_link] => https://subscene.com/subtitles/english-text/eEahuEBLjo_jAxOXb7uqIn-HDlNNckpyomovJYazgItv0-TbEJV0AwOdhVnI6NAAGwpKKQV7E1miRitP2gZSPwa9_WM8qD0dd9SgZ53iud-8nZfvXYMEPdFuZcot43gw0
        )

)
```

### smartFilterSeries

[](#smartfilterseries)

This method is using to smart filtering result from [listSubtitle](#listSubtitle), to get episode from specific release from tv series.

#### Example Request

[](#example-request-3)

```
$subscene = new Hsnfirdaus\Subscene();
$listSubtitle=$subscene->listSubtitle('ncis-eighteenth-season');
$filter = $listSubtitle->smartFilterSeries($language,$primary_type,$option);
print_r($search->getArray());
```

#### Parameters

[](#parameters-3)

ParameterTypeDefault ValueDetails`$language``string`englishThe language code/name that you will looking for (example : english).`$primary_type``array``['hdtv']`Primary subtitle type (example : \['amzn','web','hdtv'\]).`$option``array`nullOptional Option :
`season` : Season number of series, default will getting season from title.
`start_episode` : Start episode that will looking for, default : 1.
`end_episode` : End episode that will looking for, default is loop until end.
`hearing_impaired` : Is looking for hi subtitle? set true or false, default : false.#### Example Response

[](#example-response-3)

Example :

```
$listSubtitle=$subscene->listSubtitle('ncis-eighteenth-season');
$filter=$listSubtitle->smartFilterSeries('english',['amzn','web'],[
    'start_episode'=>1,
    'end_episode'=>3,
    'hearing_impaired'=>FALSE
]);
print_r($filter->getArray());
```

Response :

```
Array
(
    [type] => SMART_FILTER_SERIES
    [info] => Array
        (
            [permalink] => ncis-eighteenth-season
            [title] => NCIS: Naval Criminal Investigative Service (Navy CIS) - Eighteenth Season
            [year] => 2020
            [poster] => https://i.jeded.com/i/ncis-eighteenth-season.196526.jpg
            [imdb_id] => tt0364845
            [season] => 18
            [total_episode] => 2
            [language] => english
            [primary_type] => Array
                (
                    [0] => amzn
                    [1] => web
                )

            [missing_episode] => Array
                (
                )

        )

    [result] => Array
        (
            [1] => Array
                (
                    [id] => 2335928
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => positive
                    [name] => NCIS.S18E01.Sturgeon.Season.720p.AMZN.WEBRip.DDP5.1.x264-NTb.41 min 28
                    [hearing_impaired] =>
                    [user] => Array
                        (
                            [id] => 1068258
                            [name] => M_I_S
                        )

                    [comment] => Hi MRD :Official:WebRip&amp;webDl:41:28&nbsp;
                    [season] => 18
                    [episode] => 01
                )

            [2] => Array
                (
                    [id] => 2340604
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => positive
                    [name] => ncis.s18e02.1080p.web.h264-ggwp
                    [hearing_impaired] =>
                    [user] => Array
                        (
                            [id] => 1221159
                            [name] => class123
                        )

                    [comment] => class123&nbsp;
                    [season] => 18
                    [episode] => 02
                )

            [3] => Array
                (
                    [id] => 2351225
                    [language] => Array
                        (
                            [code] => english
                            [name] => English
                        )

                    [rate] => neutral
                    [name] => NCIS.S18E03.iNTERNAL.1080p.WEB.h264-KOGi
                    [hearing_impaired] =>
                    [user] => Array
                        (
                            [id] => 1221159
                            [name] => class123
                        )

                    [comment] => class123&nbsp;
                    [season] => 18
                    [episode] => 03
                )

        )

)
```

### smartDownloadSeries

[](#smartdownloadseries)

This method is try to download and unzip subtitle from [smartFilterSeries](#smartFilterSeries) result.

#### Example Request

[](#example-request-4)

```
$subscene = new Hsnfirdaus\Subscene();
$listSubtitle=$subscene->listSubtitle('ncis-eighteenth-season');
$filter=$listSubtitle->smartFilterSeries('english',['amzn','web'],[
    'start_episode'=>1,
    'end_episode'=>3,
    'hearing_impaired'=>FALSE
]);
$download=$filter->smartDownloadSeries($folder_target,$name_format);
print_r($download->getArray());
```

#### Parameters

[](#parameters-4)

ParameterTypeDefault ValueDetails`$folder_target``string``__DIR__.'/../../../../`The target folder that downloaded srt subtitle will saved.`$name_format``string`Rename subtitle to this string, example : 'NCIS - S%sE%s'#### Example Response

[](#example-response-4)

Example :

```
$listSubtitle=$subscene->listSubtitle('ncis-eighteenth-season');
$filter=$listSubtitle->smartFilterSeries('english',['amzn','web'],[
    'start_episode'=>1,
    'end_episode'=>3,
    'hearing_impaired'=>FALSE
]);
$download=$filter->smartDownloadSeries(__DIR__,'NCIS - S%sE%s');
print_r($filter->getArray());
```

Response :

```
Array
(
    [type] => SMART_DOWNLOAD_SERIES
    [info] => Array
        (
            [permalink] => ncis-eighteenth-season
            [title] => NCIS: Naval Criminal Investigative Service (Navy CIS) - Eighteenth Season
            [year] => 2020
            [poster] => https://i.jeded.com/i/ncis-eighteenth-season.196526.jpg
            [imdb_id] => tt0364845
            [season] => 18
            [total_episode] => 2
            [language] => english
            [primary_type] => Array
                (
                    [0] => amzn
                    [1] => web
                )

            [missing_episode] => Array
                (
                )

        )

    [result] => Array
        (
            [folder_target] => /htdocs/subtitle
            [file_failed] => Array
                (
                )

            [file_saved] => Array
                (
                    [0] => NCIS - S18E01.srt
                    [1] => NCIS - S18E02.srt
                    [2] => NCIS - S18E03.srt
                )

        )

)
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~73 days

Total

3

Last Release

1912d ago

Major Versions

v1.1 → v2.02021-02-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/fde2e93aa81d9210906f16a42db2c5b39f1e60c46fe45726ff70e9ee38d67f3c?d=identicon)[hsnfirdaus](/maintainers/hsnfirdaus)

---

Top Contributors

[![hsnfirdaus](https://avatars.githubusercontent.com/u/38871578?v=4)](https://github.com/hsnfirdaus "hsnfirdaus (7 commits)")

---

Tags

listing-subtitlessearching-subtitlessubscenesubscene-sdksubtitlesubscenedownload subtitledownload subscene

### Embed Badge

![Health badge](/badges/hsnfirdaus-subscene-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/hsnfirdaus-subscene-sdk/health.svg)](https://phpackages.com/packages/hsnfirdaus-subscene-sdk)
```

###  Alternatives

[captioning/captioning

A collection of tools to manipulate subtitles

2261.3M7](/packages/captioning-captioning)[soluble/mediatools

FFMpeg video/audio/subs conversions, thumbnails, audio extraction, query...

1451.7k](/packages/soluble-mediatools)

PHPackages © 2026

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