Bootstrap

火山平台 php_火山小视频无水印下载php源码

关于火山小视频无水印原谅很简单,下面就分享关于去除火山无水印去除源码。

调用方法:echo huoshan('https://reflow.huoshan.com/hotsoon/s/yOCZCagw700/ ');

7ef91579445215.jpg

/**

* 获取火山小视频无水印下载

* @param string $url 火山小视频分享地址

* @return json

* @example 调用方法 例: echo huoshan('https://reflow.huoshan.com/hotsoon/s/yOCZCagw700/ ');

*/

public function huoshan($url)

{

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36');

$content = curl_exec($ch);

curl_close($ch);

$pattern = '/"video_id":"(.*?)"/';

preg_match($pattern, $content, $matches);

$data_url = 'http://hotsoon.snssdk.com/hotsoon/item/video/_playback/?video_id='.$matches[1];

$ch = curl_init($data_url);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36');

curl_exec($ch);

$newurl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);

curl_close($ch);

$data = ['code' => 200, 'msg' => '获取成功!', 'download' => $newurl];

return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

}

alzf.png支付宝扫一扫

wxzf.png微信扫一扫

txzf.png企鹅扫一扫

;