XtGem Forum catalog

ChiaSeIT.Mobie.In

Share function PHP Get link Google Drive chuẩn

Drive Google là một server lớn nơi chúng ta có thể lưu trữ và chia sẻ file hoàn toàn miễn phí, hôm nay mình sẽ share code get link drive cho bạn nào làm site phim mà muốn chạy link drive nhé.
Viết vậy cho newbie nhìn cũng dễ hiểu, có thể áp dụng cho get link các site khác cũng tương tự vậy
Demo: http://www.anime9x.com/aniplugins




<?php
function ViewSource($url){
$ch = curl_init();
$timeout = 15;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.69 Safari/537.36");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function GoogleDrive($curl){
$get = ViewSource(' http://www.anime9x.com/apidrive.php?url=&#039;.$curl);
$remove = str_replace('\/','/',$get);
preg_match_all('#"(. ?)":"(. ?)"#',$remove,$data);
foreach ($data[2] as $i => $quality) {
if (strpos($data[1][$i], '1080') !== false) {
$AnimeVN .= '<source src="'.$data[2][$i].'" type="video/mp4" data-res="1080" />';
} elseif (strpos($data[1][$i], '720') !== false) {
$AnimeVN .= '<source src="'.$data[2][$i].'" type="video/mp4" data-res="720" />';
} elseif (strpos($data[1][$i], '480') !== false) {
$AnimeVN .= '<source src="'.$data[2][$i].'" type="video/mp4" data-res="480" />';
} elseif (strpos($data[1][$i], '360') !== false) {
$AnimeVN .= '<source src="'.$data[2][$i].'" type="video/mp4" data-res="360" />';
}
}
return $AnimeVN;
}
?>


Bạn nào có VPS hỗ trợ IPv6 thì xài code này nhé

<?php
function GoogleDrive($curl){
$get = AniSource($curl);
$cat = explode(',["fmt_stream_map","', $get);
$cat = explode('"]', $cat[1]);
$cat = explode(',', $cat[0]);
foreach($cat as $link){
$cat = explode('|', $link);
$links = str_replace(array('\u003d', '\u0026'), array('=', '&'), $cat[1]);
if($cat[0] == 37) {$f1080p = $links;}
if($cat[0] == 22) {$f720p = $links;}
if($cat[0] == 35) {$f480p = $links;}
if($cat[0] == 43) {$f360p = $links;}
}
if(isset($f1080p)){
$AnimeVN = "<source src=\"".$f1080p."\" type=\"video/mp4\" data-res=\"1080\" />\n<source src=\"".$f720p."\" type=\"video/mp4\" data-res=\"720\" />\n<source src=\"".$f480p."\" type=\"video/mp4\" data-res=\"480\" />\n<source src=\"".$f360p."\" type=\"video/mp4\" data-res=\"360\" />";
} elseif(isset($f720p)){
$AnimeVN = "<source src=\"".$f720p."\" type=\"video/mp4\" data-res=\"720\" />\n<source src=\"".$f480p."\" type=\"video/mp4\" data-res=\"480\" />\n<source src=\"".$f360p."\" type=\"video/mp4\" data-res=\"360\" />";
} elseif(isset($f480p)){
$AnimeVN = "<source src=\"".$f480p."\" type=\"video/mp4\" data-res=\"480\" />\n<source src=\"".$f360p."\" type=\"video/mp4\" data-res=\"360\" />";
} elseif(isset($f360p)){
$AnimeVN = "<source src=\"".$f360p."\" type=\"video/mp4\" data-res=\"360\" />";
} else {
$AnimeVN = '<source src="https://lh3.googleusercontent.com/XpE2g3UEIu7WblZ1P-Elc7KFutP13AbO1algeZgqXV0=m37" type="video/mp4" data-res="360" />';
}
return $AnimeVN;
}
?>


Chúc các bạn thành công và tận dụng được tối đa những gì mà Google cho bạn!
Nguồn: T-Design - Diễn đàn DaiVietPDA.Vn

Download


Bình luận
Từ Khóa
Share function PHP Get link Google Drive chuẩn , Drive, Google, là, một, server, lớn, nơi, chúng, ta, có, thể, lưu, trữ, và, chia , Tìm hiểu Share function PHP Get link Google Drive chuẩn làm theo và học hỏi , Bài viết Hot Share function PHP Get link Google Drive chuẩn ,
Cùng Chuyên Mục
Share code PHP game tìm Boom
Hiển thị số lượng Facebook likes / Shares / Comments với PHP
Hàm giải nén file Zip bằng PHP
Hàm tạo file Zip bằng PHP
Tự tay làm Tags Cloud cho trang web của bạn bằng PHP
Upload và giải nén file zip ngay trên web server với PHP
Share code PHP phát hiện Địa chỉ người dùng
Share code Get Link xem Video max BW Onbox.vn
Share code PHP tạo Bộ đếm cho Website của bạn
Share code tìm kiếm trong Database
Chia sẻ coding miễn phí © 2017
Thiết kế: Mạnh Tuân

sitemap.xml robots.txt U-ONC-STAT