Btjson博客 Btjson博客

乐视云解析源码(参考)

in 技术文章 read (263) 文章转载请注明来源!

只提供参考,自行测试更多资源交流群516722628 博客里面还有另外一款乐视云解析(完美解析)

<?php
/**

乐视云
*
*/

echo json_encode(LeCloud::parse($url));
/**
* 
*/
class LeCloud
{
    public static function parse($url)
    {
      $_loc1_ = $url;
      $_loc3_ = explode('|',$_loc1_);
      $uu = explode(":",$_loc3_[0])[1];
      $vu = explode(":",$_loc3_[1])[1];
      return self::get_video($uu,$vu);
    }
    public static function get_video($uuid,$vuid){
        $sign = md5("cfflashformatjsonran".time()."uu{$uuid}ver2.2vu{$vuid}2f9d6924b33a165a6d8b5d3d42f4f987");
        $v = json_decode(self::https_curl("api.letvcloud.com/gpc.php?cf=flash&format=json&ran=".time()."&uu={$uuid}&ver=2.2&vu={$vuid}&sign={$sign}"),true);
        $ltyp = array("low"=>"标清","high"=>"高清","super"=>"超清","yuanhua"=>"原画");
        foreach( $v['data']['video_info']['media'] as $l=>$row ){
            $f['mp4'][$ltyp[$l]] = base64_decode($row['play_url']['main_url']);
            $f['m3u8'][$ltyp[$l]] = str_replace("tss=no","tss=ios",base64_decode($row['play_url']['main_url']));
        }
        $data = array(
            'title' => $v['data']['video_info']['video_name'],
            'poster' => $v['data']['play_info']['init_pic'],
            'data' => $f,
        );
        $data['url'] = isset($data['data']['mp4']['原画']) ? $data['data']['mp4']['原画'] : isset($data['data']['mp4']['超清']) ? $data['data']['mp4']['超清'] : $data['data']['mp4']['高清'];
        if( $v['code']==0 ){
            $printr = array('code' => 200, 'msg' => 'success', 'play' => 'h5mp4','data' => $data);
        }else{
            $printr = array('code' => 404, 'msg' => 'ㄟ( ▔, ▔ )ㄏ,参数错误');
        }
        return $printr;
    }
    public static function https_curl($url){
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
        return curl_exec($curl);
    }
}
jrotty WeChat Pay

微信打赏

jrotty Alipay

支付宝打赏

文章二维码

扫描二维码,在手机上阅读!

本文基于《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
文章链接:https://www.pohaier.com/2018/12/04/132.html (转载时请注明本文出处及文章链接)

技术文章
发表新评论
博客已萌萌哒运行
© 2019 由 btjson 强力驱动.Theme by BTjson
PREVIOUS NEXT
雷姆
拉姆