Move Video class to a separate library

+ improve error handling
+ youtube-dl update
This commit is contained in:
Pierre Rudloff 2020-06-21 01:44:20 +02:00
parent 7d94271a49
commit 5c2823e3f1
30 changed files with 649 additions and 1152 deletions

View file

@ -6,9 +6,10 @@
namespace Alltube\Test;
use Alltube\Config;
use Alltube\Exception\ConfigException;
use Alltube\Library\Exception\AlltubeLibraryException;
use Alltube\Stream\YoutubeStream;
use Alltube\Video;
use Exception;
/**
* Unit tests for the YoutubeStream class.
@ -18,15 +19,17 @@ class YoutubeStreamTest extends StreamTest
{
/**
* Prepare tests.
* @throws Exception
* @throws ConfigException|AlltubeLibraryException
*/
protected function setUp(): void
{
parent::setUp();
$video = new Video('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '135');
$config = Config::getInstance();
$downloader = $config->getDownloader();
$video = $downloader->getVideo('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '135');
$this->stream = new YoutubeStream($video);
$this->stream = new YoutubeStream($downloader, $video);
}
/**