PHP:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>phimbw.xtgem.com xem phim max băng thông</title>
</head>
<body>
<?php
/* if(!isset($_POST['token']) && !isset($_SESSION['token'])){
$_SESSION['token'] = md5(uniqid(rand(), true));
}
*/
?>
<div class="container">
<form class="bs-example form-horizontal" method = "POST" style = "padding-top: 40px;">
<div class="form-group">
<label class="col-lg-2 control-label">link của Video</label>
<div class="col-lg-10">
<textarea type="text" class="form-control" name="video" placeholder="nhập link video vào đây"></textarea>
Chú ý nếu bạn Get nhiều video cùng một lúc thì hãy sắp xếp link đúng theo thứ tự. Và mỗi link cách nhau bới dấu ","
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button type="submit" class="btn btn-primary">Grab</button>
</div>
</div>
</form>
<div class="col-lg-10 col-lg-offset-2">
<?php
function onbox($url)
{
$ch = @curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$head[] = "Connection: keep-alive";
$head[] = "Keep-Alive: 300";
$head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$head[] = "Accept-Language: en-us,en;q=0.5";
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36');
curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Expect:'
));
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
if(isset($_POST)){
$urls = explode(",",$_POST['video']);
$count = count($urls);
if($urls['0'] == NULL){$count = 0;}
if($count != 0 ){
foreach($urls as $url){
$string= onbox(trim($url));
preg_match("#<iframe.*src='(.*)'.*>#imsU", $string, $onbox);
$string2 = onbox($onbox[1]);
preg_match("#file: '(.*)'#imsU", $string2, $link_video);
$link_video = str_replace("8080", "8181", $link_video);
$link_video = str_replace("203.190.170.158", "203.190.170.44", $link_video);
$link_video = str_replace("203.190.170.159", "203.190.170.45", $link_video);
echo $link_video[1]."<br />";
}
}
}
?>
</div></div></div>
</body>
</html>
Source: Quyền Sếc