Snack's 1967

CuDemVN.Wap.Sh

- GetSmile.Mobie.In - Diễn đàn chia sẻ Cú đêm Việt Nam
- AiChat.Wap.Sh - Diễn đàn Xtgem Việt Nam
- HamTruyen.Xtgem.Com - Blog Ham Truyện nơi hội tụ của những tín đồ mê truyện chữ
* Trang chủ >> WapMaster
Tìm Kiếm Thảo Luận
↓↓

Share function PHP Get link Google Drive chuẩn

Admin* RoSino18k *
* 13-04-2016

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

Share function PHP Get link Google Drive chuẩn
[Tải ảnh]


<?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='.$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;
}
?>


Demo: *http://www.anime9x.com/aniplugins

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! vui

Nguồn: T-Design - Diễn đàn DaiVietPDA.Vn
↓ Tập tin Đính kèm ↓
↑↑ Lượt xem: 3565
score
Đánh giá: 4.5/ 5, 3565 bình chọn
- Chia sẻ:G  T
BBCode:

Link:
+ Còn “nhiều” Lắm!
+

Share code Diễn đàn trên Xtgem Full chức năng cực chất GetSmile.Mobie.In bởi Cú Đêm Việt Nam

+

Share code PHP hiển thị thông tin khách đang online trên Site

+

Sử dụng HTML và CSS tạo hiệu ứng hiển thị mô tả khi di chuột vào hình ảnh

+

Ajax là gì? Hướng dẫn code cơ bản khi xử lý dữ liệu với jQuery Ajax

+

Share full code PHP bộ tool cài đặt và quản lý Filelist KhoTruyen365 Xtgem

Trang chủ Cú Đêm Việt Nam Trang Chủ[1-1-3565]