Cách 1
<?php
//$link = 'https://picasaweb.google.com/111132248436048010579/CauChuyenGiangSinh?authkey=Gv1sRgCLm8vfnr25ikOA#5953797600741200930';
$link = 'https://picasaweb.google.com/114053926034687574933/XemPhimBanTraiMoiCuaEmLaMa_HDThuyetMinh#6151823614282417058';
$link = isset($_GET['url']) ? $_GET['url'] : '';
error_reporting(E_ERROR | E_PARSE);
function picasa_direct($link) { $url = urldecode($link);
if (stristr($url, '#')) list($url, $id) = explode('#', $url);
$data = file_get_contents($url);
if($id) $gach = explode($id, $data);
$gach = explode('{"url":"', ($id)?$gach[7]:$data);
$v360p = urldecode(reset(explode('"', $gach[2])));
$v720p = urldecode(reset(explode('"', $gach[3])));
$v1080p = urldecode(reset(explode('"', $gach[4])));
if($v1080p != '' and ((strpos($v1080p, '=m') !== false) or (strpos($v1080p, 'https://redirector') !== false))){
$js .= 'sources: [{file:"'.$v360p.'","label":360,"type":"mp4"},';
$js .= '{file:"'.$v720p.'","label":720,"type":"mp4"},';
$js .= '{file:"'.$v1080p.'","label":1080,"type":"mp4"}],';
} elseif($v720p != '' and ((strpos($v720p, '=m') !== false) or (strpos($v720p, 'https://redirector') !== false))){
$js .= 'sources: [{file:"'.$v360p.'","label":360,"type":"mp4"},';
$js .= '{file:"'.$v720p.'","label":720,"type":"mp4"},';
$js .= '{file:"'.$v1080p.'","label":1080,"type":"mp4"}],';
} else {
$js .= 'sources: [{file:"'.$v360p.'","label":360,"type":"mp4"}],';
}
return $js;
}
echo picasa_direct($link);
?>
Cách 2
<?php
//$url = 'https://picasaweb.google.com/lh/photo/oSbE7LmJg7_RD0sEQ7jyW_hOCqZ-rWSgN0iX_85P3x4?feat=directlink';
//hoặc link này cũng ok
// $url = 'https://picasaweb.google.com/111132248436048010579/SongChetCungVeNha?authkey=Gv1sRgCJWmmNC7yoWadQ';
$url = isset($_GET['url']) ? $_GET['url'] : '';
function get_by_curl($url)
{
$ch = curl_init();
$timeout = 15;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
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 phimconggiao($url)
{
$link = file_get_contents($url);
if (preg_match_all('#image/jpeg#i',$link,$output) == true)
{
$link = explode('"type":"image/jpeg"},{"url":"',$link);
$link = explode('","',$link[1]);
$link = urldecode($link[0]);
}
else if (preg_match_all('#image/gif#i',$link,$output) == true)
{
$link = explode('"type":"image/gif"},{"url":"',$link);
$link = explode('","',$link[1]);
$link = urldecode($link[0]);
}
else
{
$link = explode('"type":"image/png"},{"url":"',$link);
$link = explode('","',$link[1]);
$link = urldecode($link[0]);
}
return $link;
}
$link = phimconggiao($url);
header('Location: '.$link);
?>
Cách 3
<?php
//$url = 'https://picasaweb.google.com/lh/photo/sx8wPLLk2KK3oIICtXPIYf8MSR-8ibaVLMcdSV-j0E0';
$url = isset($_GET['url']) ? $_GET['url'] : '';
function get_curl($url){
$ch = curl_init();
$timeout = 20;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
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 replace_picasa($link){
$datars = str_replace("\u003d","=",$link);
$datarss = str_replace("\u0026","&",$datars);
return $datarss;
}
function direct_picasa($link,$typ3) {
$id = explode('#',$link);
$id = $id[1];
$datazs = get_curl($link);
$data = explode('shared_group_'.$id,$datazs);
$data = explode('shared_group_',$data[1]);
$data = $data[0];
$datar= explode('https://redirector.googlevideo.com/videoplayback?', $data);
$datarz = explode('"', $datar[1]);
$datarss = replace_picasa($datarz[0]);
$html = "https://redirector.googlevideo.com/videoplayback?".$datarss;
return $html;
}
function LoadURLD($url){
$link = get_curl($url);
$list = direct_picasa($url,2);
return $list;
}
//echo all link
$link = LoadURLD($url);
//echo $link;
header('Location: '.$link);
?>
Cách 4
<?php
/* Tác giả: Huy Hinsky
* Website: http://www.huypv.com/
* Nếu bạn share hãy để thông tin này để tôn trọng tác giả.
*/
function get_link_redirector_picasa($linkpicasa) {
//chiêu thức get source tách link quen thuộc
$data = file_get_contents($linkpicasa);
$a = explode('"media":{"content":[', $data);
$a = explode('],"', $a[1]);
$datar = explode('},', $a[0]);
$links = array();
foreach ($datar as $key => $value) {
$value = str_replace("}}", "}", $value . "}");
$links[] = json_decode($value, true);
}
/*trả về 1 mảng với mỗi phần tử trong mảng chứa link và chất lượng
$links[index]['url'] : link redirector
$links[index]['height]: chất lượng video (360,480,720,1080)
*/
return $links;
}
function get_link_mp4_picasa($linkpicasa){
//get mảng link redirector sử dụng hàm get_link_redirector_picasa đã viết
$links= get_link_redirector_picasa($linkpicasa);
//chuẩn bị một vài biến lưu data
$links_mp4= array();
// Vòng lặp duyệt qua tất cả các link redirector
for ($i = 1; $i < count($links); $i++) {
$mp4 = array('link_mp4'=>'', 'quality'=>'');
$mp4['link_mp4']= getDirectLink($links[$i]['url']); //get link mp4
$mp4['quality'] = $links[$i]['height']; //get quality
$links_mp4[] = $mp4; //lưu vào mảng
}
return $links_mp4;
}
function getDirectLink($url) {
$urlInfo = parse_url($url);
$out = "GET {$url} HTTP/1.1\r\n";
$out .= "Host: {$urlInfo['host']}\r\n";
$out .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n";
$out .= "Connection: Close\r\n\r\n";
$con = @fsockopen('ssl://'. $urlInfo['host'], 443, $errno, $errstr, 10);
if (!$con){
return $errstr." ".$errno;
}
fwrite($con, $out);
$data = '';
while (!feof($con)) {
$data .= fgets($con, 512);
}
fclose($con);
preg_match("!\r\n(?:Location|URI): *(.*?) *\r\n!", $data, $matches);
$url = $matches[1];
return trim($url);
}
//chuẩn bị 1 mảng trả về json
$arr_data =array('link_stream'=>'','error_message'=>'');
if(isset($_GET['link_picasa']) && $_GET['link_picasa']!=''){
$link_picasa= $_GET['link_picasa'];
//sử dụng hàm get_link_mp4_picasa (hoặc hàm get link redirector)
$links_mp4 = get_link_mp4_picasa($link_picasa);
if(count($links_mp4)>0){
$arr_data['link_stream'] = $links_mp4;
}else{
$arr_data['error_message'] = 'ERROR';
}
}else{
$arr_data['error_message'] = 'ERROR';
}
echo(json_encode($arr_data)); //chuyển mảng về json
?>
Hướng dẫn cách 4:
Bạn upload file picasa_apis.php lên hosting rồi chạy URL:
http://YOUR_SITE/picasa_apis.php?link_picasa={LINK_PICASA}
Link PICASA hỗ trợ:
https://picasaweb.google.com/101481426717171601798/....
https://picasaweb.google.com/lh/photo/oSbE7LmJg7_RD0sEQ7jyW_hOCqZ-rWSgN0iX_85P3x4
. Ví dụ:
http://YOUR_SITE/picasa_apis.php?link_picasa=https://picasaweb.google.com/lh/photo/oSbE7LmJg7_RD0sEQ7jyW_hOCqZ-rWSgN0iX_85P3x4
LINK DOWNLOAD SOURCE + VÍ DỤ MINH HỌA : LINK DOWNLOAD SOURCE
0 Response to Tổng hợp các cách get dricet link Picasa
Post a Comment