Move Video class to a separate library
+ improve error handling + youtube-dl update
This commit is contained in:
parent
7d94271a49
commit
5c2823e3f1
30 changed files with 649 additions and 1152 deletions
28
README.md
28
README.md
|
@ -148,32 +148,8 @@ so that it points to your ffmpeg/avconv binary (`/usr/bin/avconv` on Debian/Ubun
|
|||
|
||||
## Use as library
|
||||
|
||||
AllTube can also be used as a library to extract a video URL from a webpage.
|
||||
|
||||
You can install it with:
|
||||
|
||||
```bash
|
||||
composer require rudloff/alltube
|
||||
```
|
||||
|
||||
You can then use it in your PHP code:
|
||||
|
||||
```php
|
||||
use Alltube\Config;
|
||||
use Alltube\Video;
|
||||
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
|
||||
Config::setOptions(
|
||||
[
|
||||
'youtubedl' => '/usr/local/bin/youtube-dl',
|
||||
]
|
||||
);
|
||||
$video = new Video('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
|
||||
$video->getUrl();
|
||||
```
|
||||
|
||||
You can also have a look at this [example project](https://github.com/Rudloff/alltube-example-project).
|
||||
The `Video` class is now available as [a separate package](https://packagist.org/packages/rudloff/alltube-library)
|
||||
so that you can reuse it in your projects.
|
||||
|
||||
## JSON API
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue