昨天发了火山小视频的,今天再来一个腾讯微视的!!

<?php

/**
 * 获取腾讯微视无水印下载
 * @param string $url 腾讯微视分享地址
 * @return json
 * @example 调用方法 例: echo weishi('https://h5.weishi.qq.com/weishi/feed/76MEn6Yjx1HTKUK6H/wsfeed?wxplay=1&id=76MEn6Yjx1HTKUK6H&spid=7485068614487183360');
 * @author Reaper <a@0oo.ren>
 * @request https://www.52bz.la
 */
function weishi($url)
{
    $pattern = '/feed\/(.*?)\//';
    preg_match($pattern, $url, $feedid);
    $ch = curl_init('https://h5.weishi.qq.com/webapp/json/weishi/WSH5GetPlayPage?feedid=' . $feedid[1]);
    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);
    $newurl = json_decode($content, 1)['data']['feeds'][0]['video_url'];
    $data = ['code' => 200, 'msg' => '获取成功!', 'download' => $newurl];
    return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}

下面是皮皮虾,抖音,火山的解析地址:




原创文章(代码),来之不易,转载请注明原著!

最后修改:2023 年 07 月 25 日
您的赞赏是对我最大的支持。