Downloads
Stars
Version
Video Platforms Parser is easy to use SDK with grabber for multiple platforms at once, like YouTube, Dailymotion, Facebook and more.
Platform | With API | Without API |
---|---|---|
YouTube | YES (key required) | YES |
Dailymotion | YES | YES |
(not ready) | YES | |
YES (key required) | YES | |
LiveLeak | NO API | YES |
CDA | NO API | YES |
Vimeo | YES | YES |
Streamable | YES | YES |
Every parser that is using API also has parser without API as backup. To use it you need to disable API for selected platform in config (not recommended).
Simply require package with composer:
composer require chojnicki/video-platforms-parser
Download zip of this repository and unpack in your PHP project. Require VideoPlatformsParser file:
require '/video-platforms-parser/src/VideoPlatformsParser.php';
Require package with composer:
composer require chojnicki/video-platforms-parser
(for Laravel below 5.5) In /config/app.php
add Service Provider:
Chojnicki\VideoPlatformsParser\ServiceProvider::class,
(for Laravel below 5.5) In /config/app.php
add Facade:
'VideoPlatformsParser' => Chojnicki\VideoPlatformsParser\Facade::class,
Publish config:
php artisan vendor:publish --provider="Chojnicki\VideoPlatformsParser\ServiceProvider"
Now You can start grabbing info like this:
$info = VideoPlatformsParser::get('https://www.youtube.com/watch?v=jofNR_WkoCE');
Require Composer to project if it was not required before
require_once 'vendor/autoload.php';
Create new object:
$parser = new Chojnicki\VideoPlatformsParser\VideoPlatformsParser(); // put array config inside
Grab video info like this:
$info = $parser->get('https://www.youtube.com/watch?v=jofNR_WkoCE');
Require parser
require '/video-platforms-parser/src/VideoPlatformsParser.php';
Manually load parsers for every video platform that will be used
require '/video-platforms-parser/src/parsers/YouTube.php';
Create new object:
$parser = new Chojnicki\VideoPlatformsParser\VideoPlatformsParser(); // put array config inside
Grab video info like this:
$info = $parser->get('https://www.youtube.com/watch?v=jofNR_WkoCE');
For every supported platform parser will return array with:
Config is located in video-platforms-parser.php or you can pass array with VideoPlatformsParser object:
Default config:
[
'youtube_api_key' => '',
'youtube_api_disabled' => false,
'dailymotion_api_disabled' => false,
'vimeo_api_disabled' => false,
'streamable_api_disabled' => false,
'twitter_api_bearer_token' => '',
'twitter_api_disabled' => false
]