richiedere file .flv da megadrive con file_get_contents_curl

Devil-94

Utente Attivo
16 Lug 2013
120
0
16
Ciao a tutti,
volevo sapere come posso richiedere (se si può) ad una pagina esterna dal nostro dominio un valore in un array.
Esempio:
il codice php è questo:
PHP:
function file_get_contents_curl($url)
{
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    $data = curl_exec($ch);
    curl_close($ch);

    return $data;
}
if(isset($_POST["getsite"])) {
if($_POST["site"] == "") {}
	
	else{
$urlcopton = $_POST["site"];

$html = file_get_contents_curl($urlcopton);

//parsing begins here:
$doc = new DOMDocument();
@$doc->loadHTML($html);
$nodes = $doc->getElementsByTagName('title');

//get and display what you need:
$title = $nodes->item(0)->nodeValue;

$metas = $doc->getElementsByTagName('meta');

for ($i = 0; $i < $metas->length; $i++)
{
    $meta = $metas->item($i);
    if($meta->getAttribute('name') == 'description')
        $description = $meta->getAttribute('content');
    if($meta->getAttribute('name') == 'keywords')
        $keywords = $meta->getAttribute('content');
}
echo "Title: $title". '<br/><br/>';
echo "Description: $description". '<br/><br/>';
echo "From: <small>$urlcopton</small>";

}
}

Che attualmente resituisce il titolo, descrizione, e il sito a cui abbiamo inviato la richiesta.
io vorrei il file .flv presente in:
Codice:
view-source:http://megadrive.tv/embed/gnbi22ixojl8
se andate su:
http://megadrive.tv/embed/gnbi22ixojl8
aprite console con f12 (Google Chrome)
digitate:
Codice:
jwplayer().getPlaylistItem()['file']
vi restituisce (simile a questo):
Codice:
"http://srv164.slavedrive.biz:182/d/vm44eqow5qrjdtugl3cabyrmpwzi6nk7gzicyhgyp22cxxor2d4fwntd/DBS001sub.flv"

Succo della questione (se possibile):

inviare la richiesta a megadrive, eseguire script(jwplayer().getPlaylistItem()['file']), ottenere il file .flv, mostrarlo al nostro dominio.​
 

Discussioni simili