微云网盘外链php源码

作者:matrix 被围观: 155,004 次 发布时间:2013-10-26 分类:兼容并蓄 零零星星 | 16 条评论 »

这是一个创建于 3797 天前的主题,其中的信息可能已经有所发展或是发生改变。

微云

微云网盘的10TB空间也要全部利用起来。

申明:此页面的源码已失效,走这里查看最新>>微云网盘php解析源码_更新

外链转换工具:http://link.hhtjim.com/

代码来自破博客

<?php  
//提取微云分享地址  
preg_match('|\/.+\/(\w+)|', $_SERVER['REQUEST_URI'], $res);  
$key = $res ? $res[1] : exit("weiyun URL error!");  
$url = $referer = "http://share.weiyun.com/$key";  
$useragent = "BlackBerry/3.6.0";  

//匹配出下载地址  
$curl = curl_init($url);  
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($curl, CURLOPT_USERAGENT, $useragent);  
curl_setopt($curl, CURLOPT_TIMEOUT, 10);  
$src = curl_exec($curl);  
curl_close($curl);  
preg_match('|http://.+sharekey[^"]+|', $src, $res);  
$url = $res ? $res[0] : exit("weiyun URL error! Not find weiyun code!"); 

//伪造referer,获取返回的响应头信息 
$curl = curl_init($url); 
curl_setopt($curl, CURLOPT_HEADER, 1); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($curl, CURLOPT_REFERER, $referer);  
curl_setopt($curl, CURLOPT_USERAGENT, $useragent); 
curl_setopt($curl, CURLOPT_TIMEOUT, 10); 
$src = curl_exec($curl); 
curl_close($curl); 

//从响应信息头匹配出真实的文件地址并下载 
preg_match('|Location: (.+)\r|', $src, $res); 
$songurl = $res ? $res[1] : exit("Can not get WeiYun Download url!"); 
header("Location: $songurl");  
//echo $songurl;  
?>  

这种方法该不错滴。

使用示例:http://XXX.php/微云URL

http://share.weiyun.com/b500a423288e8d0095d49657fe21438b

外链测试:http://link.hhtjim.com/wy/b500a423288e8d0095d49657fe21438b/逆战-张杰.mp3

 

另外一种方法,已失效

<?php   

    function curl_get($url,$post=false,$carry_ua=true){  
        $ch=curl_init($url);  
        if($carry_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 ($post) {  
            curl_setopt($ch, CURLOPT_POSTFIELDS, $post);  
        }  
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
        $get_url = curl_exec($ch);  
        curl_close($ch);  
        return $get_url;  
    }  


//echo curl_get("http://share.weiyun.com/ff731c8d95191ba06396bccde03b28b3");  

$contentS = curl_get($_GET['url']);  
if($_GET['url']){  
  $content = curl_get($_GET['url']);  
}else{  
    echo '请加上地址';  
}  
if(preg_match('|var shareInfo = (.*)\;|',$content,$ar)){  
  $content = json_decode($ar[1]);  
  // var_dump($content);  

  $uin = $content->uin;  
  $dl_svr_host = $content->dl_svr_host;  
      $dl_svr_port = $content->dl_svr_port ;  
    // $file_name = $content->file_name;  
preg_match('|<h3 class="ui-title">(.*?\.\w+)<\/h3>|',$contentS,$getfilena);  
$file_nam = ''.$getfilena[1];  
    // $file_nam = $getfilena[1] ? $getfilena[1] : exit("Can not get file name!");  
      $dl_encrypt_url = $content->dl_encrypt_url;  
  $value = 'http://'.$dl_svr_host.':'.$dl_svr_port.'/ftn_handler/'.$dl_encrypt_url.'/?fname='.$file_nam;  
//header("location:$value");  
echo $value;  
}  
?>  

优化过抓取代码,也是依照官方的下载地址做的。最终取得的下载地址貌似没用,打不开

失效,只做记录。

参考:http://bbs.cenfun.com/thread-22373-1-1.html


12-12 更新(已失效):

说明:以下代码取自外链转换工具,目前实测可用~
调用说明:http://XXX.php?u=微云URL
http://127.0.0.1/WY.php?u=http://share.weiyun.com/b500a423288e8d0095d49657fe21438b

<?php  
error_reporting(0);//禁用错误报告  
  function curl_get($url,$post=false,$carry_header=true,$REFERER_=false,$useragent=false,$add_arry_header=null){  
        $ch=curl_init($url);  

        if($carry_header){  
            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($add_arry_header){  
            curl_setopt($ch, CURLOPT_HTTPHEADER, $add_arry_header);  
        }  
        if ($post) {  
            curl_setopt($ch, CURLOPT_POSTFIELDS, $post);  
        }  
        if($REFERER_){  
            curl_setopt($ch, CURLOPT_REFERER,$REFERER_);  
        }  
        if($useragent){  
            curl_setopt($ch, CURLOPT_USERAGENT, $useragent);  
        }  

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
        $get_url = curl_exec($ch);  
        curl_close($ch);  
        return $get_url;  
    }  

    function curl_get_http($url,$REFERER_,$add_arry_header=null){  
  $curl = curl_init($url);  

curl_setopt($curl, CURLOPT_HEADER, 1);  
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
if($REFERER_){curl_setopt($curl, CURLOPT_REFERER,$REFERER_);}  
if($add_arry_header){  
            curl_setopt($curl, CURLOPT_HTTPHEADER, $add_arry_header);  
        }  
curl_setopt($curl, CURLOPT_TIMEOUT, 10);  
$src = curl_exec($curl);  
curl_close($curl);  
return $src ;  
}  
if(isset($_GET['u'])){//微云下载  
preg_match('|share\.weiyun\.com\/(\w+)|', $_GET['u'], $res);  
$wykey = $res ? $res[1] : exit('weiyun URL error!Please Check <a href="https://www.hhtjim.com/message-wall">here</a> ');  
$url = $referer = "http://share.weiyun.com/$wykey";  
$src = curl_get($url);  
preg_match('|http://.+ftn_handler[^"]+|', $src, $res);  
preg_match('|\"dlskey\":\"(\w+)\"|', $src, $dlskey);//若失败尝试发送cookies头  
$header[]= "Cookie: dlskey=$dlskey[1]"; 
$header[]= 'User-Agent: 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($res){ 
header("Location: $res[0]"); 
}else{ 
preg_match('|http://.+sharekey[^"]+|', $src, $res);  
$url = $res ? $res[0] : exit("Not find weiyun code!");  
$src = curl_get_http($url,$referer,$header);  
echo $url;  
preg_match('|Location: (.+)\r|', $src, $res);  

$wy_songurl = $res ? $res[1] : exit('Please Check <a href="https://www.hhtjim.com/message-wall">here</a> .');  
header("Location: $wy_songurl");  
}  
}  


?>
其他文章:
本文固定链接:https://www.hhtjim.com/micro-yunwang-this-chain-php-source-code.html
matrix
本文章由 matrix 于2013年10月26日发布在兼容并蓄, 零零星星分类下,目前没有通告,你可以至底部留下评论。
转载请注明:微云网盘外链php源码-HHTjim'S 部落格
关键字:, , ,

有16 条评论 »

  1. kaiser kaiser 2019-3-4 19:20:47 +0800#5

    现在也可以用吗

    • matrix matrix Moderator 2019-3-4 19:31:27 +0800

      🙈 肯定不行了

  2. 方块 方块 2014-8-31 23:19:34 +0800#4

    又在错误地方评论了,汗 请问怎样能让wp自动随机选择访客头像,没头像的,小怪兽太丑了

    • Matrix Matrix Moderator 2014-9-1 9:37:12 +0800

      不知道,我没试过

    • Matrix Matrix Moderator 2014-9-1 9:37:30 +0800

      小怪兽丑,可以换其他的啊

  3. jandown jandown 2013-12-30 14:28:07 +0800#3

    源码能否共享下?
    独乐不如众乐 :mrgreen:

    • Matrix Matrix Moderator 2013-12-30 15:30:45 +0800

      :mrgreen: 可以的啊。 :mrgreen:

      • jandown jandown 2013-12-30 19:05:09 +0800

        可否发一份到我邮箱
        yihuaixu##gmail.com
        感谢!

        • Matrix Matrix Moderator 2013-12-30 19:09:34 +0800

          😆 可以啊 你就想着发给你

      • jandown jandown 2013-12-30 19:08:51 +0800

        可否发一份 yihuaixu##gmail.com
        感谢!

        • Matrix Matrix Moderator 2013-12-30 19:11:10 +0800

          源码我会发出来的。到时候通知你吧
          这个外链其实很简单的,我都把思路写出来了

        • Matrix Matrix Moderator 2014-1-8 17:16:47 +0800

          源码放出来了,目前有很多问题。你试试 谢谢支持!
          http://www.hhtjim.com/micro-cloud-network-disk-update-php-source-code-analysis.html

  4. Lostape Lostape 2013-12-15 22:02:01 +0800#2

    百度的已经over,目测微云的也不远了,这几年发现还就威盘的稳定点。

    • Matrix Matrix Moderator 2013-12-16 0:05:56 +0800

      的确是啊,度娘生气了。 看微云也差不多。威盘...没搞

  5. ntdown ntdown 2013-12-12 10:40:34 +0800#1

    为什么代码放在我这里就行呀,一直测试不通过,有联系方式嘛!

    • Matrix Matrix Moderator 2013-12-12 12:48:07 +0800

      多谢提醒,忘更新了。
      已经补上~

添加新评论 »

 🙈 😱 😂 😛 😭 😳 😀 😆 👿 😉 😯 😮 😕 😎 😐 😥 😡 😈 💡

插入图片

NOTICE: You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!