柴郡猫-cheshirex
资源及经验分享,搬瓦工VPS

乐视云视频解析源码

乐视云视频解析源码

直接存储为.php文件然后调用即可

<?php
/**
* 乐视视频
* 严重警告:
* 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);
}

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;
}

$_loc1_ = $ui['data'];
$_loc2_ = $ui['type'];//链接清晰度
$_loc0_ = $ui['format'];//输出格式 json or 直连
$dtype = $ui['dtype'];//直连格式
$_loc3_ = explode('|',$_loc1_);
$uu = explode(":",$_loc3_[0])[1];
$vu = explode(":",$_loc3_[1])[1];

$_loc4_ = array(
'bq' => '标清',
'gq' => '高清',
'cq' => '超清',
'yh' => '原画',
);

$_loc5_ = lecloud($uu,$vu);
$_loc6_ = $_loc5_['data'];
$_loc7_ = $_loc6_['video'];

switch( $_loc0_ ){
case "json":
if( $_loc5_['status'] == 200 ){
$data = array(
'title' => $_loc6_['title'],
'video' => array(
'mp4' => $_loc7_['mp4'][$_loc4_[$_loc2_]],
'm3u8' => $_loc7_['m3u8'][$_loc4_[$_loc2_]],
)
);
$printr = $data;
}else{
$printr = array('status' => '1001', 'msg' => 'ㄟ( ▔, ▔ )ㄏ,参数错误');
}
print_r( json_encode($printr) );
exit;
break;
case "url":
if( $dtype == 'mp4' ){
$printr = $_loc7_['mp4'][$_loc4_[$_loc2_]];
}elseif( $dtype == 'm3u8' ){
$printr = $_loc7_['m3u8'][$_loc4_[$_loc2_]];
}else{
$printr = null;
}
print_r( header("location:".$printr) );
exit;
break;
default:
print_r(json_encode(array('status' => '1001', 'msg' => 'ㄟ( ▔, ▔ )ㄏ,参数错误')));
}
赞(1)
未经允许不得转载:柴郡猫-cheshirex » 乐视云视频解析源码

评论 抢沙发

评论前必须登录!