找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 197|回复: 0

56采集接口

[复制链接]
发表于 2007 年 10 月 3 日 18:09:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
楼下也有一个所谓56站程序的,忽悠到了极致,不喜欢被人忽悠的,还是自己做个站吧!
我给大家个采集接口,你爱自己采集可以用自己的FLASH播放器直接播放56.com的flv吧!不用帮人家做免费广告那么傻了!
<?php
$url = "http://www.56.com/u75/v_MTkwMTIwMjQ.html";
$html = @file_get_contents($url);
preg_match_all("/var _oFlv_o = '([\S|\s]+)'/isU", $html, $matches);
$o = decode56($matches[1][0]);
include_once "json.php"; //当php没有配置支持json的时候有用
$o = str_replace("'", '"', $o);
$o = json_decode($o);
//print_r($o);
$swf = "http://www.56.com/n_" . str_replace(":88", "", str_replace(".56.com", "", $o->img_host)) .
                                "_/" . str_replace(".56.com", "", $o->URL_host) .
                                "_/" . $o->URL_pURL .
                                "_/" . $o->URL_sURL .
                                "_/" . $o->user_id .
                                "_/" . $o->URL_URLid .
                                "_/" . $o->totaltime .
                                "_/" . $o->effectID .
                                "_/" . $o->id . ".swf";
$flv = "http://hot-chinacache.56.com/flvdownload/" . $o->URL_pURL .
                                "/" . $o->URL_sURL .
                                "/" . $o->user_id .
                                "@56.com_56flv_" . $o->URL_URLid . ".flv";
echo "FLASH文件路径: " . $swf;
echo "<br>";
echo "FLV文件路径: " . $flv;

$de = 0;
function decode56($str) {
        global $de;
        $c1 = "";
        $c2 = "";
        $c3 = "";
        $c4 = "";
        $c5 = array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);
        $c6 = charCodeAt($str, 0);
        $c7 = "";
        $i = "";
        $len = "";
        $out = "";
        if(!$de) {
                $de = 1;
                $c7 = decode56($str);
                $str = substr($c7, $c6);
        }
        $len = strlen($str);
        $i = 1;
        $out = "";
        while ($i < $len) {
                do {
                        $c1 = $c5[charCodeAt($str, $i++) & 0xff];
                }
                while($i < $len && $c1 == -1);
                if ($c1 == -1) break;
                do {
                        $c2 = $c5[charCodeAt($str, $i++) & 0xff];
                }
                while ($i < $len && $c2 == -1);
                if($c2 == -1) break;
                $out .= chr(($c1 << 2) | (($c2 & 0x30) >> 4));
                do {
                        $c3 = charCodeAt($str, $i++) & 0xff;
                        if($c3 == 61) return $out;
                        $c3 = $c5[$c3];
                }
                while ($i < $len && $c3 == -1);
                if($c3 == -1) break;
                $out .= chr((($c2 & 0XF) << 4) | (($c3 & 0x3C) >> 2));
                do {
                        $c4 = charCodeAt($str, $i++) & 0xff;
                        if($c4 == 61) return $out;
                        $c4 = $c5[$c4];
                }
                while ($i < $len && $c4 == -1);
                if ($c4 == -1) break;
                $out .= chr((($c3 & 0x03) << 6) | $c4);
        }
        return $out;
}

function charCodeAt($str, $i){
        return ord(substr($str, $i, 1));
}

//该程序仅为技术交流
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 2 月 5 日 06:49 , Processed in 0.026438 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表