From c6c221456793c8de038f3b2d0f72bab97ad1b862 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 10 Apr 2016 23:57:19 +0200 Subject: [PATCH] Remove unused functions --- classes/VideoDownload.php | 41 ------------------------------------- tests/VideoDownloadTest.php | 28 +------------------------ 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 8643207..22033cc 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -40,23 +40,6 @@ class VideoDownload ); } - /** - * Get the user agent used youtube-dl - * - * @return string UA - * */ - public function getUA() - { - $this->procBuilder->setArguments( - array( - '--dump-user-agent' - ) - ); - $process = $this->procBuilder->getProcess(); - $process->run(); - return trim($process->getOutput()); - } - /** * List all extractors * @@ -74,30 +57,6 @@ class VideoDownload return explode(PHP_EOL, $process->getOutput()); } - /** - * Get filename of video - * - * @param string $url URL of page - * @param string $format Format to use for the video - * - * @return string Filename - * */ - public function getFilename($url, $format = null) - { - $this->procBuilder->setArguments( - array( - '--get-filename', - $url - ) - ); - if (isset($format)) { - $this->procBuilder->add('-f '.$format); - } - $process = $this->procBuilder->getProcess(); - $process->run(); - return trim($process->getOutput()); - } - /** * Get all information about a video * diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index d137735..ce9e9b2 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -33,17 +33,7 @@ class VideoDownloadTest extends \PHPUnit_Framework_TestCase } /** - * Test getUA function - * - * @return void - */ - public function testGetUA() - { - $this->assertStringStartsWith('Mozilla/', $this->download->getUA()); - } - - /** - * Test listExtractors funtion + * Test listExtractors function * * @return void */ @@ -121,22 +111,6 @@ class VideoDownloadTest extends \PHPUnit_Framework_TestCase ); } - /** - * Test getFilename function - * - * @param string $url URL - * @param string $format Format - * @param string $result Expected filename - * - * @return void - * @dataProvider URLProvider - */ - public function testGetFilename($url, $format, $result) - { - $filename = $this->download->getFilename($url, $format); - $this->assertEquals($filename, $result); - } - /** * Test getJSON function *