suning云盘解析源码[PHP]
作者:matrix 被围观: 28,850 次 发布时间:2015-10-29 分类:PHP | 114 条评论 »
这是一个创建于 3310 天前的主题,其中的信息可能已经有所发展或是发生改变。
苏宁云盘的下载速度还是不错的,之前获取下载地址很简单。现在必须要求用户登录才能办到,难度也是增加不少。还好suning没做绝。GOOD LUCK!
源码
<?php
/*
需要配置苏宁账户密码
@author Pang
@url https://www.hhtjim.com
*/
error_reporting(0);
$a = new suning($_GET['id']);
$a->dl();
class suning
{
const USER = 'XXXXXX';//苏宁账户 url编码
const PAW = 'XXXXXXX';//苏宁密码
public function __construct($id)
{
$this->id = $id;
}
function tui($a)
{
die($a . '<br />Please Check <a href="https://www.hhtjim.com/message-wall#comment">here.');
}
function dl()
{
$header_2[] = 'User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16';
$header_2[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
$post = 'service=https%3A%2F%2Fpan.suning.com%2Fcloud-web%2Fauth%3FtargetUrl%3Dhttp%253A%252F%252Fpan.suning.com%252Fcloud-web%252FwapLogon.htm%253Fsk%253D'.$this->id.'&username='.self::USER.'&password='.self::PAW.'&verifyCode=';
$ticketUrl_C = $this->curl_get('https://passport.suning.com/ids/login',array('TOU'=>1,'SSL'=>1,'POST'=>$post));
$authId_2 = $this->getSet_Cookie($ticketUrl_C ,'authId');//#52 151027 修改
//echo $authId_2;
$header_4[] = 'User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16';
$header_4[] = 'Cookie: authId='.$authId_2;
//$header_4[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$dl_json = $this->curl_get('http://pan.suning.com/cloud-web/share/downShare.htm',array('POST'=>'sk='.$this->id,'ADD_HEADER_ARRAY'=>$header_4 ));
$o = json_decode($dl_json );
$dl = $dl = $o->downloadURL?$o->downloadURL:$this->tui('downloadURL.');
header('location: '.$dl,1,303);
}
function getLocation($concent)
{
preg_match('#Location: (.*)#i',$concent,$la_);
return ($la_[1] && !emptyempty($la_[1]))?$la_[1]:false;
}
function getSet_Cookie($u,$name)
{
$a = str_replace(array(': ',';'),'&',$u);
$a = str_replace(PHP_EOL,'&',$a);
parse_str($a,$re);
return array_key_exists($name,$re)&&!emptyempty($re[$name])?$re[$name]:false;
}
function curl_get($url, $array=array())
{
$defaultOptions = array(
'IPHONE_UA'=>1,
'SSL'=>0,
'TOU'=>0,
'ADD_HEADER_ARRAY'=>0,
'POST'=>0,
'REFERER'=>0,
'USERAGENT'=>0,
'CURLOPT_FOLLOWLOCATION'=>0
);
$array = array_merge($defaultOptions, $array);
$ch = curl_init($url);
if($array['SSL']){
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
}
if ($array['IPHONE_UA'])
{
curl_setopt($ch, CURLOPT_HTTPHEADER, array('User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16'));
}
if (is_array($array['ADD_HEADER_ARRAY']))
{
curl_setopt($ch, CURLOPT_HTTPHEADER, $array['ADD_HEADER_ARRAY']);
}
if ($array['POST'])
{
curl_setopt($ch, CURLOPT_POSTFIELDS, $array['POST']);
}
if ($array['REFERER'])
{
curl_setopt($ch, CURLOPT_REFERER, $array['REFERER']);
}
if ($array['USERAGENT'])
{
curl_setopt($ch, CURLOPT_USERAGENT, $array['USERAGENT']);
}
if($array['TOU']){
curl_setopt($ch, CURLOPT_HEADER, 1); //输出响应头
}
if ($array['CURLOPT_FOLLOWLOCATION'])
{
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);//自动跟踪跳转的链接
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$get_url = curl_exec($ch);
curl_close($ch);
return $get_url;
}
}
说明:
需要修改胃自己的苏宁账户和密码
调用:/su.PHP?id=XXXX
xxxx为文件id
今年就尽快 😎
看看怎么样
呃,看看怎么样,还能用么
数学考满分了没
This is a very interesting web page and I have enjoyed reading many of the articles and posts contained on the website, keep up the good work and hope to read some more interesting content in the future. Absolutely this article is incredible.
😛 😳
感谢
是啊,不知道还能用不
支持下