Top Ad unit 728 × 90

Hướng dẫn get link video v.nhaccuatui.com

Hôm nay mình hướng dẫn các bạn get link video trang v.nhaccuatui.com
Thông tin video trang v.nhaccuatui.com được lưu ở file xml, chúng ta đi tìm link xml đó để đọc thông tin là được.
Bắt Đầu
Mình lấy link này làm ví dụ : http://v.nhaccuatui.com/hoat-hinh/naruto.h4wrJ8PaG5UB.html?key=s7DuVfuK0Q7EJ
Bây giờ Ctrl + U > Ctrl + F tìm “play_key“

Ok ta xác định được là :
play_key=”9676c381f7a75330f98388096344e782“
Copy Key Vào Link Này : http://v.nhaccuatui.com/flash/xml?key=Key
Bây giờ vào link này Ctrl + U sẽ thấy toàn bộ link phim, việc cần làm là lấy nó về thôi
http://v.nhaccuatui.com/flash/xml?key=9676c381f7a75330f98388096344e782


Tạo function curl :

function curl($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_ENCODING, '');
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;
}

Và function getListMp4:

function getListMp4($link){
$content = curl($link); // đọc nội dung trang
$return = array();
preg_match("/play_key\=\"(.*)\"/",$content,$arr_preg); // tìm key
if($arr_preg){
$arrKeyXML = explode('"', $arr_preg[1]); // tách key trong chuỗi vừa tìm được
$linkXML = 'http://v.nhaccuatui.com/flash/xml?key='.$arrKeyXML[0]; // ghép key vào link xml
$xml_data = curl($linkXML); // đọc nội dung trang xml
$xml_string = str_replace("<![CDATA[","",$xml_data); // loại bỏ <![CDATA[ $xml_string = str_replace("]]>","",$xml_string); // loại bỏ ]]>
$xml_string = preg_replace('/&(?!#?[a-z0-9]+;)/', '&amp;', $xml_string); // thay thế ký tự đặc biệt
$xml_arr = json_decode(json_encode((array) simplexml_load_string($xml_string)), 1); // chuyển đổi thành mảng
if($xml_arr['track']['item']){
$arrItem = $xml_arr['track']['item'];
foreach ($arrItem as $key => $item) {
$return[$key]['link480'] = $item['location']; // link video 480p
$return[$key]['link360'] = $item['lowquality']; // link video 480p
$return[$key]['link720'] = $item['highquality']; // link video 480p
$return[$key]['title'] = $item['title']; // title
$return[$key]['image'] = $item['image']; // link image
$return[$key]['time'] = $item['time']; // time
$return[$key]['view'] = $item['view']; // lượt view
}
}
}
return $return;
}
Ok bây giờ show nó ra thôi
$link = "http://v.nhaccuatui.com/hoat-hinh/naruto.h4wrJ8PaG5UB.html?key=s7DuVfuK0Q7EJ";
$test = getListMp4($link);
echo "<pre>";
print_r($test);
Nguồn: blogit.vn
Hướng dẫn get link video v.nhaccuatui.com Reviewed by Cuong Nguyen on March 24, 2017 Rating: 5

No comments:

All Rights Reserved by Blog Chia Sẻ © 2014 - 2015
Powered by Blogger, Designed by Sweetheme

Contact Form

Name

Email *

Message *

Powered by Blogger.