ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/vidoe.top/proxy/ |
<?php /** * @author FinalDevil * @copyright 2014 */ if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')){ ob_start('ob_gzhandler'); }else{ ob_start(); } class Picasa { private $link; private $type; private $obj_array; /** * * @param string $link */ public function __construct($link) { $this->link = $link; $this->type = $this->check_link(); $this->obj_array = $this->get_json($this->get_xml_link()); } /** * * @return number */ public function check_link(){ if (preg_match('/directlink/', $this->link)){ return 1; }else { return 2; } } /** * * @return boolean|mixed */ public function view_source(){ $timeout = 15; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->link); curl_setopt($ch, CURLOPT_HTTPGET,true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_ENCODING , 'gzip, deflate'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); $result = curl_exec($ch); if(curl_errno($ch)){ return false; }else{ return $result; } } /** * * @return Ambigous <string, mixed> */ public function get_xml_link(){ $source = $this->view_source($this->link); if ( !$source){ echo 'Link die'; exit(); } $xml_link = ''; switch ($this->type){ case 1: $xml_link = explode('"application/atom+xml","href":"', $source)[1]; $xml_link = explode('"}', $xml_link)[0]; break; case 2: $start = strpos($source, 'https://picasaweb.google.com/data/feed/base/user/'); $end = strpos($source, '?alt='); $xml_link = substr($source, $start, $end - $start); $photoid = trim(explode('#', $this->link)[1], ' '); $xml_link .= '/photoid/' . $photoid . '?alt=jsonm&authkey='; $xml_link .= explode('#', explode('authkey=', $this->link)[1])[0]; $xml_link = str_replace('base', 'tiny', $xml_link); break; } return $xml_link; } /** * * @param string $xml_link * @return stdClass */ public function get_json($xml_link){ $sourceJson = file_get_contents($xml_link); $decodeJson = json_decode($sourceJson); return $decodeJson->feed->media->content; } /** * @return string * It return 720p.mp4 if has, otherwise return 480p.mp4 */ public function get_720p_mp4(){ for ($i = count($this->obj_array) - 1; $i >= 0; $i--){ if ( $this->obj_array[$i]->type == 'video/mpeg4'){ return $this->obj_array[$i]->url; } } } /** * @return string * It return 480p.mp4 */ public function get_480p_mp4(){ for ($i = 0; $i < count($this->obj_array); $i++){ if ( $this->obj_array[$i]->type == 'video/mpeg4'){ return $this->obj_array[$i]->url; } } } } /* * Cách dùng rất Ä‘Æ¡n giản, chỉ cần new 1 đối tượng picasa, truyá»n và o * tham số là link picasa ở 1 trong hai dạng, nếu link chết thì code * sẽ tá»± thoát, mình không có xá» lý phần link chết. * Gá»i hai hà m tÆ°Æ¡ng ứng để lấy link pm4. * Chú ý: Nếu chỉ có chất lượng 480 mà gá»i hà m 720 thì nó vẫn ra 480 * Dùng dạng feat=directlink dá»… bị chết hÆ¡n dạng thứ 2. */ $play = base64_decode($_GET['url']); $picasa = new Picasa($play); echo $picasa->get_480p_mp4() . '@@'; echo $picasa->get_720p_mp4(); ob_end_flush(); exit(); ?>