Giải Trí & Công Nghệ

Tool get link google drive

bkk711

bkk711

Thành viên năng động
Member

Lâu lắm rồi chưa viết 1 cái bài viết nào :))
Thôi thì share cái này cho anh em 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 :D
Mã:
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 cái này
Mã:
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($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;
}
Vậy thôi đó.

 
Bên trên