1. Introduction

1.1 Requirements

  • PHP >= 5.2
  • allow_url_fopen = TRUE

1.2 Supported services

1.3 Available information by service

Blip Dailymotion Flickr Google Video Metacafe MySpace Veoh Vimeo YouTube
Site identifier string blip dailymotion flickr googlevideo metacafe myspace veoh vimeo youtube
URL string
Title string
Description string × ×
Tags array × ×
Duration int ? × ×
Author login string ×
Author profile URL string ×
Publication date DateTime
Last update date DateTime × × × × × × ×
Thumbnails array
Flash player URL string
Files URL array flv, mov flv mp4 avi, flv, mp4 × flv flv
XML data URL string
Caption Available × Unavailable ? Unknown To be implemented

When a data is unavailable, the property is NULL or an empty array.

Details on formats

  • Publication and update dates : DateTime objects
  • Duration : seconds
  • Thumbnails : array of objects with 3 properties : url, width and height, ordered by size, in ascending order.
  • Files URL : associative array mime-type => url

MIME types of the video formats

  • AVI : video/x-msvideo
  • FLV : video/x-flv
  • MOV : video/quicktime
  • MP4 : video/mp4

2. Example of use

With

$Videopian = new Videopian();
$video = $Videopian->get('http://www.dailymotion.com/video/x2bein_vwater_ads');

or

$video = Videopian::get('http://www.dailymotion.com/video/x2bein_vwater_ads');

$video contains :

object(stdClass)#1 (14) {
  ["url"]=>
  string(50) "http://www.dailymotion.com/video/x2bein_vwater_ads"
  ["site"]=>
  string(11) "dailymotion"
  ["xml_url"]=>
  string(43) "http://www.dailymotion.com/rss/video/x2bein"
  ["title"]=>
  string(7) "V_WATER"
  ["description"]=>
  string(0) ""
  ["tags"]=>
  array(10) {
    [0]=>
    string(6) "london"
    [1]=>
    string(9) "animation"
    [2]=>
    string(6) "vwater"
    [3]=>
    string(5) "water"
    [4]=>
    string(4) "kick"
    [5]=>
    string(4) "glow"
    [6]=>
    string(6) "shield"
    [7]=>
    string(9) "de-stress"
    [8]=>
    string(6) "stress"
    [9]=>
    string(7) "vitamin"
  }
  ["duration"]=>
  int(79)
  ["author"]=>
  string(9) "tudoempaz"
  ["author_url"]=>
  string(36) "http://www.dailymotion.com/tudoempaz"
  ["date_published"]=>
  object(DateTime)#11 (0) {
  }
  ["date_updated"]=>
  NULL
  ["thumbnails"]=>
  array(1) {
    [0]=>
    object(stdClass)#12 (3) {
      ["url"]=>
      string(57) "http://www.dailymotion.com/thumbnail/320x240/video/x2bein"
      ["width"]=>
      int(320)
      ["height"]=>
      int(240)
    }
  }
  ["player_url"]=>
  string(37) "http://www.dailymotion.com/swf/x2bein"
  ["files"]=>
  array(1) {
    ["video/x-flv"]=>
    string(101) "http://www.dailymotion.com/cdn/FLV-80x60/video/x2bein?key=d4dddf3023e601f760a90fe253ad761213d7df6.flv"
  }
}

3. Demo

Please enter an video URL below to test Videopian :

4. Download

Source v0.1.1 – 29KB
Zip version v0.1.1 – 5KB

5. Roadmap

  • additionnal data support : video dimensions, more video files URLs
  • additionnal services support : Imeem, Revver, Sevenload, Viddler
  • experimental mode which parses the HTML to get the information not available through the API

6. Changelog

v0.1.1 (17.07.2009) : fixing a bug for Dailymotion videos when using the get static method

v0.1 (16.07.2009) : first stable version

About : info, contacts & more

Tool developed by Denis Hovart <denis@upian> and Hans Lemuet <hans@upian>

Since 1998, Upian is accompanying interactive agencies. Since 1998, Upian also produces independent and cultural content.

This script is referenced on freshmeat and Hot Scripts.