• 01-01-2013, 11:31:57
    #1
    merhaa güncel ve çalışan bir youtubedeki videonun linkini verebilecek script var mı
  • 01-01-2013, 22:11:18
    #2
    konu güncel

    böyle bir kod buldum ama çalışmıyor(bir kaç kez f5 yapınca bazen kendine geliyor)

    Alıntı
    <?php
    /*
    easy youtube downloader
    created by botw44
    fast scripting during work
    made during work and having ***
    */
    if(!empty($_GET["url"])) {
    function query_to_array($url) {
    $processed_url = parse_url($url);
    $query_string = $processed_url[ 'query' ];
    $query_string = explode('&', $query_string);
    $args = array();
    foreach($query_string as $chunk) {
    $chunk = explode('=', $chunk);
    if(count($chunk) == 2) {
    list($key, $val) = $chunk;
    $args[$key] = urldecode($val);
    }
    }
    return $args;
    }
    function downloadvideo($url) {
    $pattern = '/.+watch\?v=([^&]+).*/';
    preg_match($pattern, $url, $matches);
    $id = trim($matches[1]);
    $tmpres=@file_get_contents("http://youtube.com/get_video_info?video_id=".$id."");
    parse_str($tmpres, $data);
    return explode(",",$data["url_encoded_fmt_stream_map"]);
    }
    $options = array();
    foreach(downloadvideo($_GET["url"]) as $value) {
    $url = urldecode(str_replace("url=","",$value));
    $query = query_to_array($url);

    array_push($options, array(
    "url" => $url,
    "itag" => $query["itag"],
    "quality" => $query["quality"],
    ));
    }
    foreach($options as $value) {
    echo '<a href="'.$value["url"].'">download - '.$value["quality"].'</a><br />';
    }
    }
    else {
    echo 'example: ?url=http://youtube.com/watch?v=y83jr9w8j934j93';
    }
    adminlere rica konu php bölümüne taşınabilir mi