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

发布日期:2020-01-19 22:40:46

  • 正文内容
  • 相关推荐

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

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

火山去水印

<?php
/**
 * 获取火山小视频无水印下载
 * @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);
}

作者信息
头像
描述: ღ 我愿用一世阳光换你的微笑 ღ

本文标签:

文章标题:火山小视频无水印下载php源码

文章链接:https://www.dcqzz.cn/post/1064

版权声明:若无特殊注明,本文皆为 ღ哪吒ღ 原创,转载请保留文章出处。

发表评论

电子邮件地址不会被公开。 必填项已用*标注