refactor: New Video class

The news class provides a cleaner object-oriented logic

BREAKING CHANGE: The VideoDownload class has been removed and the Config constructor is now private
This commit is contained in:
Pierre Rudloff 2019-04-21 18:30:02 +02:00
parent feb8998188
commit 4c9af8ad1d
18 changed files with 665 additions and 719 deletions

View file

@ -162,19 +162,17 @@ You can then use it in your PHP code:
```php
use Alltube\Config;
use Alltube\VideoDownload;
use Alltube\Video;
require_once __DIR__.'/vendor/autoload.php';
$downloader = new VideoDownload(
new Config(
[
'youtubedl' => '/usr/local/bin/youtube-dl',
]
)
Config::setOptions(
[
'youtubedl' => '/usr/local/bin/youtube-dl',
]
);
$downloader->getURL('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
$video = new Video('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
$video->getUrl();
```
The library documentation is available on [alltube.surge.sh](https://alltube.surge.sh/classes/Alltube.VideoDownload.html).