Download the PHP package hsnfirdaus/subscene-sdk without Composer
On this page you can find all versions of the php package hsnfirdaus/subscene-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hsnfirdaus/subscene-sdk
More information about hsnfirdaus/subscene-sdk
Files in hsnfirdaus/subscene-sdk
Package subscene-sdk
Short Description A unofficial subscene.com sdk to search, download, and smart filtering subtitle
License Apache-2.0
Informations about the package subscene-sdk
Subscene SDK
A php library to getting the subtitle data and files from subscene.com website with smart filter.
Installation
Using Composer
It's recomended to install this library by Composer :
or you can just manually download this repository as zip and extract to your project directory.
Notice
If you are using the V1 of this library, please read the (README.v1.md)
Usage
Calling Class
To begin, just require the autoloader of composer :
or if you download this script manually, require the /src/Subscene.php
file :
then you just call the Subscene class like this :
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
You can use try{ } catch() { } Exception to handling error. |
Exception Name | Description |
---|---|---|
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
- search
- Example Request
- Parameters
- Example Response
- listSubtitle
- Example Request
- Parameters
- Example Response
- getSubtitle
- Example Request
- Parameters
- Example Response
- smartFilterSeries
- Example Request
- Parameters
- Example Response
- smartDownloadSeries
- Example Request
- Parameters
- Example Response
Search
This method is using to search movie or series that subtitle is available in subscene.
Example Request
Parameters
Parameter | Type | Default Value | Details |
---|---|---|---|
$query |
string |
null | The title for movie/series that you want to search. |
Example Response
Example response :
listSubtitle
This method is using to listing subtitle from specific permalink.
Example Request
Parameters
Parameter | Type | Default Value | Details |
---|---|---|---|
$permalink |
string |
null | The permalink of page that you will looking for list subtitle. |
Example Response
Example response :
getSubtitle
This method is using to generate download link and information of specific subtitle.
Example Request
Parameters
Parameter | Type | Default Value | Details |
---|---|---|---|
$permalink |
string |
null | The permalink of page that you will get the subtitle. |
$lang_code |
string |
null | The language code of subtitle. |
$id |
integer |
null | The id of subtitle. |
Example Response
Example response :
smartFilterSeries
This method is using to smart filtering result from listSubtitle, to get episode from specific release from tv series.
Example Request
Parameters
Parameter | Type | Default Value | Details |
---|---|---|---|
$language |
string |
english | The language code/name that you will looking for (example : english). |
$primary_type |
array |
['hdtv'] |
Primary subtitle type (example : ['amzn','web','hdtv']). |
$option |
array |
null | Optional 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 :
smartDownloadSeries
This method is try to download and unzip subtitle from smartFilterSeries result.
Example Request
Parameters
Parameter | Type | Default Value | Details |
---|---|---|---|
$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 :