diff --git a/classes/Config.php b/classes/Config.php index d80a657..2e2bf11 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -57,6 +57,7 @@ Class Config /** * Get singleton instance + * * @return Config */ public static function getInstance() diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 8364278..9e2b435 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -32,7 +32,10 @@ Class VideoDownload static function getUA() { $config = Config::getInstance(); - $cmd = escapeshellcmd($config->python.' '.escapeshellarg($config->youtubedl).' '.$config->params); + $cmd = escapeshellcmd( + $config->python.' '.escapeshellarg($config->youtubedl). + ' '.$config->params + ); exec( $cmd.' --dump-user-agent', $version @@ -48,7 +51,10 @@ Class VideoDownload static function listExtractors() { $config = Config::getInstance(); - $cmd = escapeshellcmd($config->python.' '.escapeshellarg($config->youtubedl).' '.$config->params); + $cmd = escapeshellcmd( + $config->python.' '.escapeshellarg($config->youtubedl). + ' '.$config->params + ); exec( $cmd.' --list-extractors', $extractors @@ -67,7 +73,10 @@ Class VideoDownload static function getFilename($url, $format=null) { $config = Config::getInstance(); - $cmd = escapeshellcmd($config->python.' '.escapeshellarg($config->youtubedl).' '.$config->params); + $cmd = escapeshellcmd( + $config->python.' '.escapeshellarg($config->youtubedl). + ' '.$config->params + ); if (isset($format)) { $cmd .= ' -f '.escapeshellarg($format); } @@ -90,7 +99,10 @@ Class VideoDownload static function getJSON($url, $format=null) { $config = Config::getInstance(); - $cmd = escapeshellcmd($config->python.' '.escapeshellarg($config->youtubedl).' '.$config->params); + $cmd = escapeshellcmd( + $config->python.' '.escapeshellarg($config->youtubedl). + ' '.$config->params + ); if (isset($format)) { $cmd .= ' -f '.escapeshellarg($format); } @@ -116,7 +128,10 @@ Class VideoDownload static function getURL($url, $format=null) { $config = Config::getInstance(); - $cmd = escapeshellcmd($config->python.' '.escapeshellarg($config->youtubedl).' '.$config->params); + $cmd = escapeshellcmd( + $config->python.' '.escapeshellarg($config->youtubedl). + ' '.$config->params + ); if (isset($format)) { $cmd .= ' -f '.escapeshellarg($format); } diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 29c8d1a..8a1074f 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -29,6 +29,7 @@ class FrontController /** * Display index page + * * @return void */ static function index() @@ -55,6 +56,7 @@ class FrontController /** * Display a list of extractors + * * @return void */ static function extractors() @@ -79,6 +81,7 @@ class FrontController /** * Dislay information about the video + * * @return void */ static function video() @@ -130,7 +133,8 @@ class FrontController ); header("Content-Type: audio/mpeg"); passthru( - 'curl '.$config->curl_params.' --user-agent '.escapeshellarg($UA). + 'curl '.$config->curl_params. + ' --user-agent '.escapeshellarg($UA). ' '.escapeshellarg($video->url). ' | '.$config->avconv. ' -v quiet -i - -f mp3 -vn pipe:1' @@ -180,6 +184,7 @@ class FrontController /** * Redirect to video file + * * @return void */ static function redirect() @@ -198,6 +203,7 @@ class FrontController /** * Output JSON info about the video + * * @return void */ static function json() diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 75b59e9..718eb0f 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -28,6 +28,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase /** * Test the getInstance function + * * @return void */ public function testGetInstance()