Exemple #1
2
function getvideo($id, $pid = 2)
{
    $hz = '_letv';
    $pidarrs[] = '350';
    $pidarrs[] = '1000';
    $pidarrs[] = '720p';
    $stime = 'http://api.letv.com/time?tn=0.' . time();
    $str = get_curl_contents($stime);
    $t = preg_match('|{"stime":(\\d+)}|', $str, $matchs) ? $matchs[1] : false;
    $content = get_curl_contents('http://api.letv.com/mms/out/video/play?id=' . $id . '&platid=1&splatid=101&domain=http://www.letv.com&tkey=' . getKey($t), 0, 0, 1);
    $data = preg_match('~<playurl><!\\[cdata\\[(.*)\\]\\]></playurl>~iUs', $content, $matchs) ? $matchs[1] : false;
    $json = json_decode($data);
    $pido = '';
    if (strpos($data, '"720p"')) {
        $pido = '3';
    }
    if (!$pido) {
        if (strpos($data, '"1000"')) {
            $pido = '2';
        }
    }
    if (!$pido) {
        $pido = '1';
    }
    switch ($pido) {
        case '1':
            $qvars = __BQ__ . '_' . $id . $hz;
            break;
        case '2':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz;
            break;
        case '3':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz . '|' . __CQ__ . '_' . $id . $hz;
            break;
        default:
            $qvars = $id . $hz;
            break;
    }
    $pid = min($pid, $pido);
    $dispatch = $json->dispatch->{$pidarrs}[$pid - 1];
    $urllist['urls'][0]['url'] = str_replace('tss=ios', 'tss=no', $dispatch[0]);
    $urllist['vars'] = '{h->1}{a->' . $qvars . '}{f->' . __HOSTURL__ . '?url=[$pat' . ($pid - 1) . ']}';
    return $urllist;
}
Exemple #2
0
function k2url($k)
{
    $content = get_curl_contents('http://v2.tudou.com/f?sj=1&sid=10000&hd=2&id=' . $k . '&rand=' . time());
    preg_match('~>(http[s]{0,1}://.*)<~iUs', $content, $vurl);
    strpos($vurl[1], '&amp;') and $url = strtr($vurl[1], array('&amp;' => '&'));
    return $url;
}
Exemple #3
0
function getvideo($id)
{
    $content = get_curl_contents('http://v2.tudou.com/v?vn=02&st=1%2C2&it=' . str_replace(' ', '', $id));
    $urllist[0]['url'] = inter($content, 'brt="2">', '<');
    $urllist[0]['sec'] = '';
    $urllist[0]['size'] = '';
    return $urllist;
}
Exemple #4
0
function getvideo($id)
{
    $id = explode('-', $id);
    $url = "http://pan.baidu.com/share/link?shareid=" . $id[0] . "&uk=" . $id[1];
    $contents = get_curl_contents($url);
    $tzurl = inter($contents, 'dlink\\":\\"', '\\"');
    $urllist[0]['url'] = stripslashes(stripslashes($tzurl));
    $urllist[0]['sec'] = '';
    $urllist[0]['size'] = '';
    return $urllist;
}
Exemple #5
0
function getvideo($id, $pid = 2)
{
    $pidarrs[] = '';
    $pidarrs[] = '600';
    $pidarrs[] = '1500';
    $hz = '_ku6';
    $content = get_curl_contents('http://v.ku6.com/fetchVideo4Player/' . $id . '.html');
    $data = json_decode($content);
    $json = $data->data;
    $srctype = $json->srctype;
    if ($srctype) {
        $pido = '2';
        if ($srctype > 2) {
            $pido = '3';
        }
    } else {
        $pido = '1';
    }
    switch ($pido) {
        case '1':
            $qvars = __BQ__ . '_' . $id . $hz;
            break;
        case '2':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz;
            break;
        case '3':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz . '|' . __CQ__ . '_' . $id . $hz;
            break;
        default:
            $qvars = $id . $hz;
            break;
    }
    $pid = min($pid, $pido);
    $vtime = explode(',', $json->vtime);
    $urls = explode(',', $json->f);
    $rate = $pidarrs[$pid - 1];
    if ($rate) {
        $rate = '?rate=' . $rate;
    }
    $j = count($urls);
    if ($j == 1) {
        $urllist['urls'][0]['url'] = $urls[0] . $rate;
        $urllist['urls'][0]['sec'] = $vtime[0];
    } else {
        for ($i = 0; $i < $j; $i++) {
            $urllist['urls'][$i]['url'] = $urls[$i] . $rate;
            $urllist['urls'][$i]['sec'] = $vtime[$i + 1];
        }
    }
    $urllist['vars'] = '{h->3}{q->rate}{a->' . $qvars . '}{f->' . __HOSTURL__ . '?url=[$pat' . ($pid - 1) . ']}';
    return $urllist;
}
Exemple #6
0
function getbaidu($id)
{
    if (strpos($id, '-')) {
        $id = explode('-', $id);
        $url = "http://pan.baidu.com/share/link?shareid=" . $id[0] . "&uk=" . $id[1];
    } else {
        $url = "http://pan.baidu.com/s/" . $id;
    }
    $content = get_curl_contents($url);
    //简单的匹配不用正则效率更高
    $tzurl = explode('dlink\\":\\"', $content);
    $tzurl = explode('\\"', $tzurl[1]);
    $tzurl = $tzurl[0];
    return stripslashes(stripslashes($tzurl));
}
Exemple #7
0
function getvideo($id)
{
    $content = get_curl_contents('http://app.letv.com/v.php?id=' . $id);
    $wd3 = inter($content, '<mmsJson>', '</mmsJson>');
    $wd3 = inter($wd3, '<![CDATA[', ']]>');
    $data = json_decode($wd3);
    $wd4 = $data->bean->video;
    $wd5 = $wd4[0]->url;
    $content2 = get_curl_contents($wd5);
    $data2 = json_decode($content2);
    $wd6 = $data2->location;
    $urllist[0]['url'] = 'http://' . inter($wd6, 'http://', '.letv') . '.' . inter($wd6, 'video_type=', '&');
    $urllist[0]['sec'] = '';
    $urllist[0]['size'] = '';
    return $urllist;
}
Exemple #8
0
function fetch_youku_flv($url)
{
    preg_match("#id_(.*?)\\.html#", $url, $out);
    $id = $out[1];
    $content = get_curl_contents('http://v.youku.com/player/getPlayList/VideoIDS/' . $id);
    $data = json_decode($content);
    foreach ($data->data[0]->streamfileids as $k => $v) {
        $sid = getSid();
        $fileid = getfileid($v, $data->data[0]->seed);
        $one = $data->data[0]->segs->{$k};
        if ($k == 'flv' || $k == 'mp4') {
            return "http://f.youku.com/player/getFlvPath/sid/{$sid}_00/st/{$k}/fileid/{$fileid}?K={$one[0]->k}";
        }
        continue;
    }
}
Exemple #9
0
function getbaidu($id)
{
    if (strpos($id, '-')) {
        $id = explode('-', $id);
        $url = "http://pan.baidu.com/share/link?shareid=" . $id[0] . "&uk=" . $id[1];
    } else {
        $url = "http://pan.baidu.com/s/" . $id;
    }
    $content = get_curl_contents($url);
    return preg_match('~;;_dlink="(.+)?";~iUs', $content, $getid) ? $getid[1] : '';
    /*
    $tzurl=explode('dlink\":\"',$content);
    $tzurl=explode('\"',$tzurl[1]);
    $tzurl=$tzurl[0];
    return stripslashes(stripslashes($tzurl));
    */
}
Exemple #10
0
function getvideo($id)
{
    $content2 = get_curl_contents('http://v.ku6.com/fetchVideo4Player/' . $id . '.html');
    $data = json_decode($content2);
    $wd2 = $data->data->f;
    $wd5 = $data->data->vtime;
    $wd3 = explode(',', $wd2);
    $wd6 = explode(',', $wd5);
    $wd4 = '';
    for ($i = 0, $j = count($wd3); $i < $j; $i++) {
        $urllist[$i]['url'] = $wd3[$i];
        $urllist[$i]['sec'] = $wd6[$i];
    }
    if (!$urllist[0]['url']) {
        $urllist[0]['url'] = $wd2;
        $urllist[0]['sec'] = $wd5;
    }
    return $urllist;
}
Exemple #11
0
function getvideo($id)
{
    $content = get_curl_contents('http://vxml.56.com/json/' . $id . '/?src=out');
    $data = json_decode($content);
    $wd2 = $data->info->rfiles;
    for ($i == 0; $i < count($wd2); $i++) {
        $type = $wd2[$i]->type;
        if ($type == 'normal') {
            $wd3 = $wd2[$i]->url;
            break;
        }
    }
    if (!$wd3) {
        $wd3 = $wd2[0]->url;
    }
    $urllist[0]['url'] = $wd3;
    $urllist[0]['sec'] = '';
    $urllist[0]['size'] = '';
    return $urllist;
}
Exemple #12
0
function getvideo($id)
{
    $content = get_curl_contents('http://v.youku.com/player/getPlaylist/VideoIDS/' . $id);
    $data = json_decode($content);
    $fileid_ = $data->data[0]->streamfileids;
    $fileid2_ = $fileid_->hd2;
    $sk = 'hd2';
    if (!$fileid2_) {
        $fileid2_ = $fileid_->mp4;
        $sk = 'mp4';
    }
    if (!$fileid2_) {
        $fileid2_ = $fileid_->flv;
        $sk = 'flv';
    }
    $sid = getSid();
    $fileid3_ = getfileid($fileid2_, $data->data[0]->seed);
    $filed1_ = substr($fileid3_, 0, 8);
    $filed2_ = substr($fileid3_, 10);
    $segs = $data->data['0']->segs->{$sk};
    $i = 0;
    $urllist = '';
    foreach ($segs as $seg1 => $v1) {
        $AA = strtoupper(dechex($i)) . '';
        if (strlen($AA) < 2) {
            $AA = '0' . $AA;
        }
        $filed_ = $filed1_ . $AA . $filed2_;
        $k1 = $v1->k;
        $k2 = $v1->k2;
        $size = $v1->size;
        $seconds = $v1->seconds;
        $sk = str_replace('hd2', 'flv', $sk);
        $urllist[$seg1]['url'] = 'k.youku.com/player/getFlvPath/sid/_00/st/' . $sk . '/fileid/' . $filed_ . '?K=' . $k1 . ',k2=' . $k2;
        $urllist[$seg1]['size'] = $size;
        $urllist[$seg1]['sec'] = $seconds;
        $i += 1;
    }
    return $urllist;
}
Exemple #13
0
function getYoukuFlv($url)
{
    //preg_match("#id_(.*?)\.html#",$url,$out);
    //$id=$out[1];
    $url2 = str_replace('_wd1', '', $url);
    //echo $url2;
    $content = get_curl_contents('http://v.youku.com/player/getPlayList/VideoIDS/' . $url2);
    $data = json_decode($content);
    $fileid_ = $data->data[0]->streamfileids;
    $fileid2_ = $fileid_->mp4;
    $sk = 'mp4';
    if (!$fileid2_) {
        $fileid2_ = $fileid_->flv;
        $sk = 'flv';
    }
    $sid = getSid();
    $fileid3_ = getfileid($fileid2_, $data->data[0]->seed);
    $filed1_ = substr($fileid3_, 0, 8);
    $filed2_ = substr($fileid3_, 10);
    //print_r($filed2_);
    $segs = $data->data[0]->segs->{$sk};
    $i = 0;
    //echo dechex(5);
    foreach ($segs as $seg1 => $v1) {
        $AA = strtoupper(dechex($i));
        if (count($AA) < 2) {
            $AA = '0' . $AA;
        }
        $i += 1;
        $filed_ = $filed1_ . $AA . $filed2_;
        $k1 = $v1->k;
        $k2 = $v1->k2;
        if ($i > 1) {
            $urllist .= '|';
        }
        $urllist .= 'http://f.youku.com/player/getFlvPath/sid/00_00/st/' . $sk . '/fileid/' . $filed_ . '?K=' . $k1 . ',k2=' . $k2;
    }
    return $urllist;
}
Exemple #14
0
function getvideo($id, $pid = 2)
{
    $hz = '_youku';
    $pidarrs[] = 'flv';
    $pidarrs[] = 'mp4';
    $pidarrs[] = 'hd2';
    $pidarrs[] = 'hd3';
    $content = get_curl_contents('http://v.youku.com/player/getPlayList/VideoIDS/' . $id);
    $data = json_decode($content);
    $fileid_ = $data->data[0]->streamfileids;
    $fileid2_ = $fileid_->hd3;
    $pido = '4';
    if (!$fileid2_) {
        $fileid2_ = $fileid_->hd2;
        $pido = '3';
    }
    if (!$fileid2_) {
        $fileid2_ = $fileid_->mp4;
        $pido = '2';
    }
    if (!$fileid2_) {
        $fileid2_ = $fileid_->flv;
        $pido = '1';
    }
    switch ($pido) {
        case '1':
            $qvars = __BQ__ . '_' . $id . $hz;
            break;
        case '2':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz;
            break;
        case '3':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz . '|' . __CQ__ . '_' . $id . $hz;
            break;
        case '4':
            $qvars = __BQ__ . '_' . $id . $hz . '|' . __GQ__ . '_' . $id . $hz . '|' . __CQ__ . '_' . $id . $hz . '|' . __YH__ . '_' . $id . $hz;
            break;
        default:
            $qvars = $id . $hz;
            break;
    }
    $pid = min($pid, $pido);
    $sk = $pidarrs[$pid - 1];
    $fileid2_ = $fileid_->{$sk};
    $sid = getSid();
    $fileid3_ = getfileid($fileid2_, $data->data[0]->seed);
    $filed1_ = substr($fileid3_, 0, 8);
    $filed2_ = substr($fileid3_, 10);
    $segs = $data->data['0']->segs->{$sk};
    $i = 0;
    $urllist = '';
    foreach ($segs as $seg1 => $v1) {
        $AA = strtoupper(dechex($i)) . '';
        if (strlen($AA) < 2) {
            $AA = '0' . $AA;
        }
        $filed_ = $filed1_ . $AA . $filed2_;
        $k1 = $v1->k;
        $k2 = $v1->k2;
        $size = $v1->size;
        $seconds = $v1->seconds;
        $sk = str_replace('hd2', 'flv', $sk);
        $sk = str_replace('hd3', 'flv', $sk);
        $urllist['urls'][$seg1]['url'] = 'http://f.youku.com/player/getFlvPath/sid/00_00/st/' . $sk . '/fileid/' . $filed_ . '?K=' . $k1 . ',k2=' . $k2;
        $urllist['urls'][$seg1]['size'] = $size;
        $urllist['urls'][$seg1]['sec'] = $seconds;
        $i += 1;
    }
    $urllist['vars'] = '{h->2}{a->' . $qvars . '}{f->' . __HOSTURL__ . '?url=[$pat' . ($pid - 1) . ']}';
    return $urllist;
}
Exemple #15
0
/**
 * Get cUrl Contents Plus Crawler
 */
function get_curl_contents_crawler($url, $timeout = 5)
{
    $contents = get_curl_contents($url, $timeout);
    return new \Symfony\Component\DomCrawler\Crawler($contents);
}
Exemple #16
0
function getYouku($url)
{
    if (strpos($url, 'html')) {
        $url2 = inter($url, 'id_', '.html');
    } elseif (strpos($url, 'swf')) {
        $url2 = inter($url, '/sid/', '/');
    } else {
        $url2 = str_replace('_wd1', '', $url);
    }
    $content = get_curl_contents('http://v.youku.com/player/getPlayList/VideoIDS/' . $url2);
    $data = json_decode($content);
    $fileid_ = $data->data[0]->streamfileids;
    $fileid2_ = $fileid_->mp4;
    $sk = 'mp4';
    if (!$fileid2_) {
        $fileid2_ = $fileid_->flv;
        $sk = 'flv';
    }
    $sid = getSid();
    $fileid3_ = getfileid($fileid2_, $data->data[0]->seed);
    $filed1_ = substr($fileid3_, 0, 8);
    $filed2_ = substr($fileid3_, 10);
    $segs = $data->data[0]->segs->{$sk};
    $i = 0;
    $urllist = '';
    foreach ($segs as $seg1 => $v1) {
        $AA = strtoupper(dechex($i)) . '';
        if (strlen($AA) < 2) {
            $AA = '0' . $AA;
        }
        $filed_ = $filed1_ . $AA . $filed2_;
        $k1 = $v1->k;
        $k2 = $v1->k2;
        $size = $v1->size;
        $seconds = $v1->seconds;
        $urllist .= '		<video>' . chr(13);
        $urllist .= '			<file>http://f.youku.com/player/getFlvPath/sid/00_00/st/' . $sk . '/fileid/' . $filed_ . '?K=' . $k1 . ',k2=' . $k2 . '</file>' . chr(13);
        $urllist .= '			<size>' . $size . '</size>' . chr(13);
        $urllist .= '			<seconds>' . $seconds . '</seconds>' . chr(13);
        $urllist .= '		</video>' . chr(13);
        $i += 1;
    }
    $urllist2 = '<?xml version="1.0" encoding="utf-8"?>' . chr(13);
    $urllist2 .= '	<ckplayer>' . chr(13);
    $urllist2 .= '	<flashvars>' . chr(13);
    $urllist2 .= '		{h->2}' . chr(13);
    $urllist2 .= '	</flashvars>' . chr(13);
    $urllist2 .= $urllist;
    $urllist2 .= '	</ckplayer>';
    echo $urllist2;
}
Exemple #17
0
function getvideo($id, $pid = 2)
{
    $hz = '_56';
    $pidarrs[] = 'normal';
    $pidarrs[] = 'wvga';
    $pidarrs[] = 'super';
    $content = get_curl_contents('http://vxml.56.com/json/' . $id . '/?src=out');
    $data = json_decode($content);
    $rfiles = $data->info->rfiles;
    for ($i = 0; $i < count($rfiles); $i++) {
        $type = $rfiles[$i]->type;
        $urls[$type] = $rfiles[$i]->url;
    }
    //print_r($urls);die;
    $pido = '';
    if (isset($urls['super'])) {
        $pido = '3';
    }
    if (!$pido) {
        if ($urls['wvga']) {
            $pido = '2';
        }
    }
    if (!$pido) {
        if ($urls['qvga']) {
            $pido = '2';
        }
        $pidarrs[1] = 'qvga';
    }
    if (!$pido) {
        if ($urls['vga']) {
            $pido = '2';
        }
        $pidarrs[1] = 'vga';
    }
    if (!$pido) {
        if ($urls['clear']) {
            $pido = '2';
        }
        $pidarrs[1] = 'clear';
    }
    if (!$pido) {
        $pido = '1';
    }
    switch ($pido) {
        case '1':
            $qvars = 'bq_' . $id . $hz;
            break;
        case '2':
            $qvars = 'bq_' . $id . $hz . '|gq_' . $id . $hz;
            break;
        case '3':
            $qvars = 'bq_' . $id . $hz . '|gq_' . $id . $hz . '|cq_' . $id . $hz;
            break;
        default:
            $qvars = $id . $hz;
            break;
    }
    $pid = min($pid, $pido);
    if ($pid == 2) {
        !isset($urls[$pidarrs[1]]) && ($pidarrs[1] = 'clear');
        !isset($urls[$pidarrs[1]]) && ($pidarrs[1] = 'qvga');
        !isset($urls[$pidarrs[1]]) && ($pidarrs[1] = 'vga');
    }
    $urllist['urls'][0]['url'] = $urls[$pidarrs[$pid - 1]];
    $urllist['vars'] = '{h->3}{a->' . $qvars . '}{f->' . __HOSTURL__ . '?url=[$pat' . ($pid - 1) . ']}';
    return $urllist;
}
Exemple #18
0
function getyk($vid, $qxd)
{
    $api = "http://play.youku.com/play/get.json";
    $app = "&ran=";
    $ctype = "&ct=" . chr(dechex(bindec(X))) . chr(dechex(bindec(Y)));
    $kurl = "http://k.youku.com/player/getFlvPath/sid/";
    $url = $api . "?vid=" . $vid . $ctype . $app . rand(0, 9999);
    $html = get_curl_contents($url);
    $jdata = json_decode($html);
    $jdata1 = $jdata->data;
    $oip = $jdata1->security->ip;
    $ep = $jdata1->security->encrypt_string;
    if ($ep == "") {
        return "视频不存在!";
        exit;
    }
    $stream = $jdata1->stream;
    $st = explode('_', yk_e('becaf9be', yk_na($ep)));
    $sid = $st[0];
    $token = $st[1];
    if ($sid == "") {
        echo "sidnull";
        return;
    }
    if ($token == "") {
        echo "tokennull";
        return;
    }
    $definition = $stream;
    // 当没有传指定清晰度的值的时候,默认输出最高清晰度,所以需要循环视频所有清晰度,然后再取最后一个清晰度。
    // 定义一个数组用来存放清晰度数据
    $types = array();
    // 用foreach循环来把获得的清晰度数据加入到指定数组中  可以用来智能识别清晰度的值
    foreach ($definition as $key => $v) {
        $stream_type = $v->stream_type;
        $audio_lang = $v->audio_lang;
        if ($stream_type == "3gphd") {
            //3gp清晰度一般用不到,因为是分段的,改成手机端也放不了,所以这里直接跳过
            continue;
        }
        if ($audio_lang == "default" || $audio_lang == "guoyu") {
            array_push($types, $stream_type);
        }
    }
    $xhcs = count($types);
    $hden2 = array("bq", "gq", "cq", "hd2");
    if ($qxd == "") {
        $vtype = $hden2[count($types) - 1];
        $qxurl = $vtype . SG . $vid . HZ;
        $vtype = $types[count($types) - 1];
    } else {
        $vtype2 = $qxd;
        $qxurl = $vtype2 . SG . $vid . HZ;
    }
    // 判断是否存在该清晰度
    // 重置清晰度的值 将传过来的参数cq/gq/bq/转化成原始清晰度数据
    /*如果传的参数含有清晰度则需要进一步判断*/
    // 加个if判断,提高效率,如果不加if不管参数是否带清晰度都会执行一次。
    if ($vtype2 != "") {
        for ($i = 0; $i < count($types); $i++) {
            if ($hden2[$i] == $vtype2) {
                $num = $i;
                $vtype = $types[$num];
                break;
            }
        }
        // 判断是否存在该清晰度
        if ($vtype == "") {
            $vtype = $types[count($types) - 1];
            //如果不存在指定的清晰度,则默认输出该视频存在的最高清晰度
        }
    }
    $yktypes = array("flvhd", "mp4hd", "mp4hd2", "mp4hd3");
    $ykhd = array("0", "1", "2", "3");
    $ykformatname = array("flv", "mp4", "flv", "flv");
    $ykclear = array("标清", "高清", "超清", "1080");
    $ykarr = array("type" => $yktypes, "hd" => $ykhd, "fn" => $ykformatname, "cl" => $ykclear);
    $title = $jdata1->show->title;
    if ($title == "") {
        $title = $jdata1->video->title;
    }
    $xml["data"]["qxurl"] = $qxurl;
    $xml["data"]["defa"] = getdefa($xhcs, $vid);
    $xml["data"]["deft"] = getdeft($xhcs);
    $xml["data"]["phpself"] = $_SERVER['PHP_SELF'];
    $xml["data"]["title"] = $title;
    foreach ($stream as $key => $v) {
        $stream_fileid = $v->stream_fileid;
        $stream_type = $v->stream_type;
        if ($stream_type == $vtype) {
            $segs = $v->segs;
            $fileid_1 = substr($stream_fileid, 0, 8);
            $fileid_2 = substr($stream_fileid, 10);
            for ($i = 0; $i < count($types); $i++) {
                if ($stream_type == $ykarr["type"][$i]) {
                    $hd = $ykarr["hd"][$i];
                    $formatname = $ykarr["fn"][$i];
                    $clear = $ykarr["cl"][$i];
                    break;
                }
            }
            $xml["data"]["clear"] = $clear;
            foreach ($segs as $k => $value) {
                $hex = strtoupper(dechex($k)) . "";
                if (strlen($hex) < 2) {
                    $hex = '0' . $hex;
                }
                $fileid = $fileid_1 . $hex . $fileid_2;
                $ep1 = urlencode(iconv("gbk", "UTF-8", yk_d(yk_e('bf7e5f01', $sid . '_' . $fileid . '_' . $token))));
                $key = $value->key;
                $ts = $value->total_milliseconds_video;
                $downlink = $kurl . $sid . "_" . $hex . "/st/" . $formatname . "/fileid/" . $fileid . "?K=" . $key . "&hd=" . $hd . "&myp=0&ts=" . intval($ts / 1000.0) . "&ypp=0&ymovie=1&ctype=" . str_replace("&ct=", "", $ctype) . "&ev=1&token=" . $token . "&oip=" . $oip . "&ep=" . $ep1;
                $xml["data"]["url"][$k]["downlink"] = $downlink;
                $xml["data"]["url"][$k]["size"] = $value->size;
                $xml["data"]["url"][$k]["ts"] = intval($ts / 1000.0);
            }
            return $xml;
        }
    }
    return;
}
Exemple #19
0
function getvideoid($url)
{
    $data['status'] = 0;
    if (strpos($url, 'youku.com')) {
        $data['type'] = 'youku';
        if (strpos($url, 'html')) {
            $data['id'] = inter($url, 'id_', '.html');
        } elseif (strpos($url, 'swf')) {
            $data['id'] = inter($url, '/sid/', '/');
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'yunpan.cn')) {
        $data['type'] = '360';
        $data['id'] = $url;
    } elseif (strpos($url, 'tudou.com') || strpos($url, 'tudouui.com')) {
        $data['type'] = 'tudou';
        $data['id'] = '';
        if (strpos($url, 'swf')) {
            $wd = inter($url, 'iid=', '/');
            if (strpos($wd, 'swf')) {
                $wd = inter($url, 'iid=', '&');
            }
            $data['id'] = $wd;
        }
        if (!$data['id']) {
            $content = get_curl_contents($url);
            $wd = inter($content, 'vcode:"', '"');
            if (!$wd) {
                $wd = inter($content, 'vcode: \'', '\'');
            }
            if ($wd) {
                $data['type'] = 'youku';
                $data['id'] = $wd;
            } else {
                $data['id'] = trim(inter($content, 'iid:', ','));
            }
        }
        if (!$data['id']) {
            urldebug($url);
        }
    } elseif (strpos($url, 'letv.com')) {
        $data['type'] = 'letv';
        if (strpos($url, 'swf')) {
            $wd = inter($url, 'swf?id=', '&');
            $data['id'] = $wd;
        } else {
            $content = get_curl_contents($url);
            $wd = inter($content, 'vid:', ',');
            if ($wd) {
                $data['id'] = $wd;
            } elseif ($wd == 0) {
                $data['id'] = inter($content, 'vid=', '&');
            } else {
                urldebug($url);
            }
        }
    } elseif (strpos($url, '56.com')) {
        $data['type'] = '56';
        if (strpos($url, 'v_')) {
            $wd = inter($url, 'v_', '.');
        } elseif (strpos($url, 'cpm_')) {
            $wd = inter($url, 'cpm_', '.');
        } elseif (strpos($url, 'vid-')) {
            $wd = inter($url, 'vid-', '.');
        } elseif (strpos($url, 'open_')) {
            $wd = inter($url, 'open_', '.');
        } elseif (strpos($url, 'redian/')) {
            $wd = explode('redian/', $url);
            $wd2 = explode('/', $wd[1]);
            $wd = '';
            $wd = $wd2[0];
            if ($wd2[1]) {
                $wd = $wd2[1];
            }
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'pan.baidu') || strpos($url, 'yun.baidu')) {
        $data['type'] = 'baidu';
        if (strpos($url, 'shareid=')) {
            list($add, $wd) = explode('link?', $url);
            strpos($url, '&shareid=') && (list($uk, $id) = explode('&shareid=', $wd));
            strpos($url, '&uk=') && (list($id, $uk) = explode('&uk=', $wd));
            $id = strtr($id, array("shareid=" => ""));
            $uk = strtr($uk, array("uk=" => ""));
            $wd = $id . '-' . $uk;
        } else {
            list($add, $wd) = explode('/s/', $url);
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'ku6.com')) {
        $data['type'] = 'ku6';
        if (strpos($url, 'html')) {
            $arr = explode('/', $url);
            $wd = $arr[count($arr) - 1];
            $wd = str_replace('.html', '', $wd);
        } elseif (strpos($url, 'swf')) {
            $arr = explode('/', $url);
            $wd = $arr[count($arr) - 2];
        } else {
            urldebug($url);
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } else {
        $data['type'] = 'url';
        $data['id'] = $url;
    }
    return $data;
}
Exemple #20
0
function getvideoid($url)
{
    $data['status'] = 0;
    if (strpos($url, 'youku.com')) {
        $data['type'] = 'youku';
        if (strpos($url, 'html')) {
            $data['id'] = inter($url, 'id_', '.html');
        } elseif (strpos($url, 'swf')) {
            $data['id'] = inter($url, '/sid/', '/');
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'tudou.com') || strpos($url, 'tudouui.com')) {
        $data['type'] = 'tudou';
        $data['id'] = '';
        if (strpos($url, 'swf')) {
            $wd = inter($url, 'iid=', '/');
            if (strpos($wd, 'swf')) {
                $wd = inter($url, 'iid=', '&');
            }
            if (!$wd) {
                $url1 = inter($url, 'v/', '/');
                $url = "http://www.tudou.com/programs/view/" . $url1 . "/";
            }
            $data['id'] = $wd;
        }
        if (!$data['id']) {
            $content = get_curl_contents($url);
            $wd = inter($content, 'vcode:"', '"');
            if (!$wd) {
                $wd = inter($content, 'vcode: \'', '\'');
            }
            if ($wd) {
                $data['type'] = 'youku';
                $data['id'] = $wd;
            } else {
                $data['id'] = DeleteHtml(inter($content, 'iid:', ','));
            }
        }
        if (!$data['id']) {
            urldebug($url);
        }
    } elseif (strpos($url, 'letv.com')) {
        $data['type'] = 'letv';
        if (strpos($url, 'swf')) {
            $wd = inter($url, 'swf?id=', '&');
            $data['id'] = $wd;
        } else {
            $content = get_curl_contents($url);
            $wd = inter($content, 'vid:', ',');
            if ($wd) {
                $data['id'] = $wd;
            } elseif ($wd == 0) {
                $data['id'] = inter($content, 'vid=', '&');
            } else {
                urldebug($url);
            }
        }
    } elseif (strpos($url, '56.com')) {
        $data['type'] = '56';
        if (strpos($url, 'v_')) {
            $wd = inter($url, 'v_', '.');
        } elseif (strpos($url, 'vid-')) {
            $wd = inter($url, 'vid-', '.');
        } elseif (strpos($url, 'open_')) {
            $wd = inter($url, 'open_', '.');
        } elseif (strpos($url, 'redian/')) {
            $wd = explode('redian/', $url);
            $wd2 = explode('/', $wd[1]);
            $wd = '';
            $wd = $wd2[0];
            if ($wd2[1]) {
                $wd = $wd2[1];
            }
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'pan.baidu')) {
        $data['type'] = 'baidu';
        $wd = explode('shareid=', $url);
        $arrr = array("&uk=" => "-");
        $wd = strtr($wd[1], $arrr);
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'ku6.com')) {
        $data['type'] = 'ku6';
        if (strpos($url, 'html')) {
            $arr = explode('/', $url);
            $wd = $arr[count($arr) - 1];
            $wd = str_replace('.html', '', $wd);
        } elseif (strpos($url, 'swf')) {
            $arr = explode('/', $url);
            $wd = $arr[count($arr) - 2];
        } else {
            urldebug($url);
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } else {
        $data['type'] = 'url';
        $data['id'] = $wd;
    }
    return $data;
}