乐视云 (Letvcloud)

2017-4-1 admin Code

<?php
/**
 * 乐视视频
 *
 * 
 * @author     lonewolf<http://themesfield.com.cn>
 * @version    1.0
 * @data       2016-09-01 14:59:57
 *
 *
 * 严重警告:
 * 1、源码仅供学习交流使用。
 * 2、禁止用于危害官方利益的行为。
 * 3、禁止用于违反法律法规的行为。
 * 
 *
 */
error_reporting(0);
header('Content-type: text/json;charset=utf-8');
$ui = array();
foreach($_GET as $key => $value){
    $ui[$key] = trim($value);
}
/*
if( empty($ui['vid']) || !is_numeric($ui['vid']) ){
    die('Please attach relevant parameters!');
}
*/
 
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);
}
 
function lecloud($uuid,$vuid){
    $sign = md5("cfflashformatjsonran".time()."uu{$uuid}ver2.2vu{$vuid}2f9d6924b33a165a6d8b5d3d42f4f987");
    $v = json_decode(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'],
        'video' => $f,
    );
    if( $v['code']==0 ){
        $printr = array('status' => '200', 'msg' => 'success', 'data' => $data);
    }else{
        $printr = array('status' => '1001', 'msg' => 'ㄟ( ▔, ▔ )ㄏ,参数错误');
    }
    return $printr;
}
 
$uuid = '9a41a0d696';
$vuid = '3263b0983d';
 
print_r( lecloud($uuid,$vuid) );

标签: 乐视

发表评论:

Powered by emlog