Witam, mam taki skrypt jak poniżej
<?php
/************* MegaVideo Downloader *******************/
/*
Released by AwesomePHP.com, under the GPL License, a
copy of it should be attached to the zip file, or
*/
/************* MegaVideo Downloader *******************/
// Cookie File
$COOKIE_FILE = 'mv_cookie.txt';
//MegaVideo Username (premium)
$USERNAME = 'login';
//MegaVideo Password (premium)
$PASSWORD = 'haslo';
/*
get_url function is invoked when
the movie file is the flash and not
the movie page
*/
function get_url($id){
$fp = fsockopen ('www.megavideo.com', '80', $errno, $errstr, 30
); if ($fp){
$query = "GET /v/$id HTTP/1.1\r\n";
$query .= "Host: www.megavideo.com\r\n\r\n";
}
} else {
return NULL;
}
return "http://www.megavideo.com/?v=".$temp2[0];
}
/*
function to get the download link
from megavideo
*/
function get_dlink($vlink,$COOKIE_FILE,$USERNAME,$PASSWORD){
/*
If cookie file doesn't exist, it means we need to login
*/
//URL
$url = 'http://www.megavideo.com/?s=signup';
/* Post Data */
$postData['nickname'] = $USERNAME;
$postData['password'] = $PASSWORD;
$postData['action'] = 'login';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIE_FILE);
curl_setopt($ch, CURLOPT_COOKIEJAR, $COOKIE_FILE);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
$buffer = curl_exec($ch);
curl_close($ch);
}
/*
Check link format, and if we need to get
link of actual movie page
*/
$final_link = get_url($temp[1]);
} else {
$final_link = $vlink;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$vlink);
curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIE_FILE);
curl_setopt($ch, CURLOPT_COOKIEJAR, $COOKIE_FILE);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
$buffer = curl_exec($ch);
curl_close($ch);
preg_match('|BORDER="0" ALT=""></a> <a href="(http.*)" target="_blank" style="font-weight:normal; ">Download original</a>|U',$buffer,$result); return $result[1];
}
/*
Test
*/
echo get_dlink
('http://www.megavideo.com/?v=17JIAQW9');
echo get_dlink
('http://www.megavideo.com/v/17JIAQW97d2eb89ed9a082ebafdc64591627b648.5621461736.0'); ?>
jednak wywala on taki błąd:
Getting
link for [url
="http://www.megavideo.com/?v=17JIAQW9"]http
://www.megavideo.com/?v=17JIAQW9[/url]
Warning
: Missing argument 2
for get_dlink
(), called in
/var/www
/gmvu
.php on line 103 and
defined in
/var/www
/gmvu
.php on line 47
Warning
: Missing argument 3
for get_dlink
(), called in
/var/www
/gmvu
.php on line 103 and
defined in
/var/www
/gmvu
.php on line 47
Warning
: Missing argument 4
for get_dlink
(), called in
/var/www
/gmvu
.php on line 103 and
defined in
/var/www
/gmvu
.php on line 47
Getting
link for [url
="http://www.megavideo.com/v/17JIAQW97d2eb89ed9a082ebafdc64591627b648.5621461736.0"]http
://www.megavideo.com/v/17JIAQW97d2eb89...48.5621461736.0[/url]
Warning
: Missing argument 2
for get_dlink
(), called in
/var/www
/gmvu
.php on line 106 and
defined in
/var/www
/gmvu
.php on line 47
Warning
: Missing argument 3
for get_dlink
(), called in
/var/www
/gmvu
.php on line 106 and
defined in
/var/www
/gmvu
.php on line 47
Warning
: Missing argument 4
for get_dlink
(), called in
/var/www
/gmvu
.php on line 106 and
defined in
/var/www
/gmvu
.php on line
47
W czym może być problem? Pozdrawiam.
Ten post edytował fuqet 11.03.2010, 20:25:13