How to get Vine video url

后端 未结 3 1555
后悔当初
后悔当初 2020-12-28 10:10

I love vinepeek and want to make something better.

I have the Vine link e.g. http://vine.co/v/bJqWrOHjMmU, however this is a link to a page, not the vid

3条回答
  •  难免孤独
    2020-12-28 10:53

    This is a simple function which i use to get video src from curl result. http://vine.co/v/bJqWrOHjMmU

    function getVineVideoFromUrl($url) {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $res = curl_exec($ch);
        preg_match('/twitter:player:stream.*content="(.*)"/', $res, $output);
        return $output[1];
    }
    

    result

    https://vines.s3.amazonaws.com/v/videos/08C49094-DFB4-46DF-8110-EEEC7D4D6115-1133-000000B8AD9BE72C_1.0.1.mp4?versionId=ms6ePoPeFm6NQZkeNHegV3k_ZLV4bz9x
    

提交回复
热议问题