首页 > 开发 > PHP > 正文

56.com视频采集接口程序(PHP)

2024-05-04 22:13:09
字体:
来源:转载
供稿:网友
楼下也有一个所谓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);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表