lolabits.es网站需要cURL帮助,我想获取视频下载网址

时间:2016-03-11 18:17:05

标签: php curl

我从lolabits.es网站上获取下载链接网址。我正在给它输入精确的视频网址,并希望打印其下载链接。 我正在使用的代码是: require_once'functions.php';

$referer        = 'http://lolabits.es/AdrielxD/One+Piece/One+Piece+700+*7e+750/One+Piece+-+729,76621268.mp4(video';
$post  = '';
$cookieFileName = getcwd() . DIRECTORY_SEPARATOR . "temp" . DIRECTORY_SEPARATOR . "cookie2.txt"; 
$answer = curl_request($referer, false, true, $cookieFileName);
$page = $answer;
$doc = new DOMDocument();
@$doc->loadHTML($page);
$xml = simplexml_import_dom($doc);

$total_page = $xml->xpath("//input[@name='__RequestVerificationToken']");
$reqToken  = $total_page[0]->attributes()->value;

//$action = $xml->xpath("//form[@class='download_form']");
//echo $action  = $action[0]->attributes()->action;

$fileID = $xml->xpath("//input[@name='FileId']");
$fileID  = $fileID[0]->attributes()->value;

echo $URL = "http://lolabits.es/action/License/Download"; echo "<br>";
echo $post = "?fileId=".$fileID."&__RequestVerificationToken=$reqToken";
echo $answer = curl_request($URL, $post, 'Content-Type: application/x-www-    form-urlencoded; charset=utf-8',
                            true, $cookieFileName, false, $referer);

echo "<br><br><br>";            
$link = json_encode($answer);
echo "<br><br><br>";
echo $link = json_decode($answer);

echo $link->redirectUrl;

请告诉我错误的地方,并提出最佳解决方案。 我也为它附加了脾气数据图像。

脾气数据图像 enter image description here

0 个答案:

没有答案