<?php
$url="https://api.aliyundrive.com/adrive/v3/file/list";
$body = array("share_id"=>"VGDgJPCw2My","parent_file_id"=>"61d28fb3164163b8cd08460baabb915574c1b455","limit"=>100,"image_thumbnail_process"=>"image/resize,w_160/format,jpeg","image_url_process"=>"image/resize,w_1920/format,jpeg","video_thumbnail_process"=>"video/snapshot,t_1000,f_jpg,ar_auto,w_300","order_by"=>"name","order_direction"=>"DESC");
$header = array("accept"=>"application/json, text/plain, */*", "accept-language"=>"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6","content-length"=>"324","content-type"=>"application/json","origin"=>"https://www.aliyundrive.com","referer"=>"https://www.aliyundrive.com/"
,"x-device-id"=>"uk+8G4wqjScCAXkIDZ6HLjoN","x-canary"=>"client=web,app=share,version=v2.3.1"
,"x-share-token"=>"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21Kc29uIjoie1wiZG9tYWluX2lkXCI6XCJiajI5XCIsXCJzaGFyZV9pZFwiOlwiVkdEZ0pQQ3cyTNJKU2hfHGFYLoD1Bvxjix3AVxH4SEmaYuZDJmZjM1Y2FkZWZhZjYyXCIsXCJ1c2VyX2lkXCI6XCJhbm9ueW1vdXNcIn0iLCJjdXN0b21UeXBlIjoic2hhcmVfbGluayIsImV4cCI6MTNJKU2hfHGFYLoD1Bvxjix3AVxH4SEmaYufQ.IsuwA-_EgolmZgrON_LeYT6-OOxEHxERBZmqlAOQgNdHBLWy8ws48WqxAFNQqFaXJnSNtIalgco9Rag3XYI-SLFQ87lSCd8ZdTV0GDlL2Oy73AkDDu-vvOKoNq_qOds--mos_9v4oe0qD1uHFgZdl6VcaE9NTDPJJXo70HnI4Rg");
$result = curlPost($url, $body, 5, $header, 'json');
// print_r($header);
// print_r($body);
var_dump($result);
/**
* 传入数组进行HTTP POST请求
*/
function curlPost($url, $post_data = array(), $timeout = 5, $header = "", $data_type = "") {
$header = empty($header) ? '' : $header;
//支持json数据数据提交
if($data_type == 'json'){
$post_string = json_encode($post_data);
}elseif($data_type == 'array') {
$post_string = $post_data;
}elseif(is_array($post_data)){
$post_string = http_build_query($post_data, '', '&');
}
$ch = curl_init(); // 启动一个CURL会话
curl_setopt($ch, CURLOPT_URL, $url); // 要访问的地址
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 对认证证书来源的检查 // https请求 不验证证书和hosts
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
//curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
//curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
curl_setopt($ch, CURLOPT_POST, true); // 发送一个常规的Post请求
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); // Post提交的数据包
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // 设置超时限制防止死循环
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
//curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 获取的信息以文件流的形式返回
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //模拟的header头
$result = curl_exec($ch);
// 打印请求的header信息
//$a = curl_getinfo($ch);
//var_dump($a);
curl_close($ch);
return $result;
}
版权说明
文章采用: 《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权。版权声明:未标注转载均为本站原创,转载时请以链接形式注明文章出处。如有侵权、不妥之处,请联系站长删除。敬请谅解!
常见资源合集和破解beqptwpmc...