PHP flv stream mit php speichern

Hallo,
ich habe grade folgendes problem. Ich möchte gerne mit php ein video speichern.
Ich habe zum Video zum beispiel diesen Link
httX://www.XouXube.com/get_video?video_id=xxXXxxXX&t=blablablablabblabla

Hat jemand eine Idee wie dies am besten zu realisieren ist?
Gruß -Tux-
 
schau dir mit nem netzwerksniffer oder nen decompiler an, was genau an den server gesendet wird, bevor der stream anfäng, also zb irgendwelche postdaten.
anschließend kannste nen httpheader hinschicken mit fsockopen oder auch mit der curl php erweiterung arbeiten.

ansonst gibts für youtube doch unzählige anbieter von browserplugins, convertertools und sonstiges.
was willste denn konkret machen?

edit://
google haste nich genutzt oder?
PHP:
<?php
/*******************************************************************************
 *                      Youtube Class
 *******************************************************************************
 *      Author:     Vikas Patial
 *      Email:      admin@ngcoders.com
 *      Website:    http://www.ngcoders.com
 *
 *      File:       youtube.php
 *      Version:    1.0.0
 *      Copyright:  (c) 2008 - Vikas Patial
 *                  You are free to use, distribute, and modify this software 
 *                  under the terms of the GNU General Public License.  See the
 *                  included license.txt file.
 *      
 *******************************************************************************
 *  VERION HISTORY:
 *
 *      v1.0.0 [18.9.2008] - Initial Version
 *
 *******************************************************************************
 *  DESCRIPTION:
 *
 *      NOTE: See www.ngcoders.com for the most recent version of this script 
 *      and its usage.
 *
 *******************************************************************************
*/


class youtube {
    
    var $conn = false;
    var $username = "";
    var $password = "";
       
     // login only if required ( 18+ videos ) 
     
    function _login()
    {
        $url = "http://www.youtube.com/login?username=".$this->username."&password=".$this->password."&next=/index&current_form=loginForm&action_login=1";
        $html = $this->conn->get($url);
        
        return strstr($html,"Sign Out")?true:false;
    }
    
    function get($url)
    {
        $this->conn = new Curl('youtube');
        
        $html = $this->conn->get($url);

        if (strstr($html,'please verify you are 18')) 
        {
            if(!$this->_login())
            {
                return false;
            }
            
            $this->conn->cookie = 'is_adult=1';
            $html = $this->conn->get($url);
        }
                
        if(!preg_match('/"video_id": "(.*?)"/', $html, $match) || !preg_match('/"t": "(.*?)"/', $html, $match1))
        {
            return false;
        }
        
        $var_id = $match[1];
        $var_t  = $match1[1];
        
        $this->conn = new Curl('youtube');
        
        $url = "http://www.youtube.com/get_video?video_id=".$var_id."&t=".$var_t;
        
        $this->conn->follow = false;
        $this->conn->header = true;


        $html =  $this->conn->get($url);

        if(preg_match('/Location: (.*?)[\r\n]+/',$html,$match))
        {
            return $match[1];
        }
                    
        return $url;
        
    }
    
}

erster treffer bei http://www.google.de/search?q=php+y...&rls=org.mozilla:de:official&client=firefox-a

edit2://

wenn du es noch einfacher haben willst.

PHP:
<?php $vid = file_get_contents(http://www.youtube.com/get_video?video_id=4C-rgHEdDrI&t=vjVQa1PpcFMbmAc8vXduZBzCcN3_p2ZzQQ_CYZ9KXQ4%3D; ?>)

so den rest schaffste aber nun alleine !! ;)
 
Zuletzt bearbeitet:
Hi,
doch ich habe auch google benutzt ;)

Mit file_get_contents() hab ichs schon probiert. das klappt mit kleinen videos wunderbar nur leider hab ich da bei etwas größeren videos meine probleme bekommen.
Gruß
 
Zurück
Oben