citcit / autoembed

Automatically exported from code.google.com/p/autoembed
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Support Megavideo ?d= solution #61

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
hi,

I want to offer the solution to convert megavideo link, ?=d to ?v=

function:

function get_vlink($dlink){

    $rawdata=file_get_contents($dlink);
    $temp = explode('flashvars.v = "',$rawdata);
    $temp2 = explode('";',$temp[1]);
    if (strlen($temp2[0])>3) {
    return "".$temp2[0];
    } else {
    return $dlink;
    }
}

Example usage:

    $vlink=get_vlink("http://www.megavideo.com/?d=IT2ESBK0");
    echo $vlink;  //output: http://www.megavideo.com/?v=DY3XYCSH

Enjoy!

Original issue reported on code.google.com by fbb...@gmail.com on 15 Oct 2011 at 2:03

Attachments: