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:
parent
feb8998188
commit
4c9af8ad1d
18 changed files with 665 additions and 719 deletions
16
README.md
16
README.md
|
@ -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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue