mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Use league/climate in ColorCLI class
This commit is contained in:
@@ -15,17 +15,19 @@ if (! empty($argv[1]) && ! empty($argv[2]) && ($argv[2] !== 'series' || $argv[2]
|
||||
// Search for a show
|
||||
$search = $omdb->search((string) $argv[1], (string) $argv[2]);
|
||||
if (is_object($search) && $search->data->Response !== 'False') {
|
||||
print_r($search->data->Search[0]->Title.PHP_EOL);
|
||||
dump($search->data->Search[0]->Title.PHP_EOL);
|
||||
}
|
||||
|
||||
// Use the first show found (highest match) and get the requested season/episode from $argv
|
||||
if (is_object($search) && $search->data->Response !== 'False') {
|
||||
$search = $omdb->fetch('i', $search->data->Search[0]->imdbID);
|
||||
|
||||
print_r($search);
|
||||
dump($search);
|
||||
} else {
|
||||
exit(ColorCLI::error('Error retrieving OMDb API data.'));
|
||||
ColorCLI::error('Error retrieving OMDb API data.');
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
exit(ColorCLI::error('Invalid arguments. This script requires a text string (show name), and a second argument, movie or series.'));
|
||||
ColorCLI::error('Invalid arguments. This script requires a text string (show name), and a second argument, movie or series.');
|
||||
exit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user