This package is abandoned and no longer maintained. No replacement package was suggested.

Extract videos from any URL

1.1.5 2014-11-07 12:49 UTC

This package is auto-updated.

Last update: 2022-02-01 12:23:05 UTC


Vex is a PHP library to extract a video from any URL.

Supported Services

For each video-sharing website of the following list, a Platform class can identify a supported URL and extract the video data.


This project is DEPRECATED and should NOT be used.

If someone magically appears and wants to maintain this project, I'll gladly give access to this repository.


The recommended way to install Vex is through composer.

    "require": {
        "kphoen/vex": "1.1.*"

If you don't use neither Composer nor a ClassLoader in your application, just require the provided autoloader:

require_once 'src/autoload.php';

You're done.


use Vex\Vex;

$adapter = new \Vex\HttpAdapter\BuzzHttpAdapter();
$platform = \Vex\Platform\RutubePlatform($adapter);
$vex = new Vex($platform);

$video = $vex->extract('');

// Show the video title
echo $video->getTitle();
// Shows the embedded video HTML
echo $video->getCode();
// Show the video link
echo $video->getLink();
// Show the video duration
echo $video->getDuration();
// Show the video thumbnail
echo $video->getThumb();

$url = $vex->reverse('<iframe width="640" height="360" src="" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen scrolling="no"></iframe>');
// shows
echo $url


To run unit tests, you'll need cURL and a set of dependencies you can install using Composer:

php composer.phar install --dev

Once installed, just launch the following command:




Vex is released under the MIT License. See the bundled LICENSE file for details.