Merge pull request #20 from ukdtom/master

No worries :)
This commit is contained in:
Luke L
2015-01-03 21:53:30 +00:00
2 changed files with 24 additions and 7 deletions

6
README
View File

@@ -38,3 +38,9 @@ Features: (or: things I'll try and add as and when I get time)
* Sort by name, year, rating etc
* Pull in favourites from Plex
* More detailed TV Show popup (seasons, episodes etc)
Notes2:
* If your Plex Server is running in Home mode, we need to authenticate via a token
* To get a valid token for your system, look here: https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token
* Then when running cli.php, add a parameter like: -token=<Your Token>

25
cli.php
View File

@@ -36,14 +36,25 @@ error_reporting(E_ALL ^ E_NOTICE | E_WARNING);
$options['absolute-data-dir'] = dirname(__FILE__).'/'.$options['data-dir']; // Run in current dir (PHP CLI defect)
$options['sort-skip-words'] = (array) explode(',', $options['sort-skip-words']); # comma separated list of words to skip for sorting titles
// Create the http header with a X-Plex-Token in it
$headers = array(
'http'=>array(
'method'=>"GET",
'header'=>"X-Plex-Token: ".$options['token']
)
);
// Create the http header with a X-Plex-Token in it if specified
if (strlen($options['token']) == 0){
$headers = array(
'http'=>array(
'method'=>"GET"
)
);
}
else
{
$headers = array(
'http'=>array(
'method'=>"GET",
'header'=>"X-Plex-Token: ".$options['token']
)
);
}
$context = stream_context_create($headers);
check_dependancies(); // Check everything is enabled as necessary