Skip to content Skip to sidebar Skip to footer

Get .mp4 Source And Poster Image From Vine Id (php)

How to get video.mp4 from vine url? Example: from https://vine.co/v/hnVVW2uQ1Z9 I need http://.../*.mp4 and http://.../*.jpg Script what I need use this page vinebed.com (In PHP) T

Solution 1:

It's very simple. if you check the source of a vine video from vine.co you'll see the meta tags. and you should see twitter:player:stream. By using php you can extract that information specifically and use it like a variable.

<?phpfunctionvine($id)
{
        $vine = file_get_contents("http://vine.co/v/{$id}");
        preg_match('/property="twitter:player:stream" content="(.*?)"/', $vine, $matches);
        $url = $_SERVER['REQUEST_URI'];
        return ($matches[1]) ? $matches[1] : false;

}
?>

And to set an $id you will need to create a function that will either A) Automatically read a vine video id by url and you can display it like this <?php echo vine('bv5ZeQjY35'); ?> or B) Just set a vine video id and display as is.

Hope this helps as it's worked for me just fine.

Post a Comment for "Get .mp4 Source And Poster Image From Vine Id (php)"