Beispiel #1
0
            $freadtimes = 0;
            $file = fopen($file_path, "rb");
            @stream_set_blocking($file, 0);
            @ob_clean();
            if ($file) {
                while (!feof($file) & 0 == connection_status()) {
                    $tttt = fread($file, "10240");
                    echo $tttt;
                    $loadedsize += strlen($tttt) / 1024;
                    @ob_flush();
                    @flush();
                    @usleep(60);
                    $freadtimes++;
                    if ($freadtimes > 30000) {
                        break;
                    }
                }
                fclose($file);
            }
        }
    } else {
        echo "<b>SERVER[YOUTUBE-INDEX]</b>:URL LENGTH ERR";
        echo "<br>URL=<br>";
        echo $file_path;
        echo "<hr><pre>";
        $v = getVInfo($vid);
        $vlist = url_encoded_fmt_stream_map($v);
        echo $v;
        var_dump($vlist);
    }
}
Beispiel #2
0
function loadvideo($vid, $type = "")
{
    if (isset($_SESSION['vurl_expire_' . $vid])) {
        if (time() > $_SESSION['vurl_expire_' . $vid]) {
            unset($_SESSION['vurl_' . $vid]);
        }
    }
    if (!isset($_SESSION['vurl_' . $vid])) {
        $vlist = url_encoded_fmt_stream_map(getVInfo($vid));
        $_SESSION['vurl_' . $vid] = $vlist;
        $_SESSION['vurl_expire_' . $vid] = time() + 60 * 35;
    }
}
Beispiel #3
0
<?php

include 'xinc.php';
if (isset($_GET['uri'])) {
    $key = $_GET['uri'];
    switch ($_GET['type']) {
        case 'watch':
            include 'nglib.php';
            $f = getVInfo($key);
            //net('http://www.youtube.com/get_video_info?video_id='.$key);
            $a = array();
            parse_str($f, $a);
            if (count($a) < 4) {
                header('location: fixer.php');
                die('<a href="fixer.php">FIX ERROR</a>');
            }
            $title = $a['title'];
            //$vlist=getVList($f,array());
            break;
        case 'thumb':
            if (USE_PHP_IMAGE_PROXY) {
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, 'http://i.ytimg.com/vi/' . $key . '/0.jpg');
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
                @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                $f = curl_exec($ch);
                curl_close($ch);
                @ob_end_clean();
                header('Content-Type: image/jpeg');
                die($f);