Advertisement
Guest User

photos

a guest
Aug 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1. <?php
  2. function curl($url){
  3.     $ch = @curl_init();
  4.     curl_setopt($ch, CURLOPT_URL, $url);
  5.     $head[] = "Connection: keep-alive";
  6.     $head[] = "Keep-Alive: 300";
  7.     $head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
  8.     $head[] = "Accept-Language: en-us,en;q=0.5";
  9.     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36');
  10.     curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
  11.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12.     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  13.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  14.     curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  15.     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  16.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  17.     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  18.     $page = curl_exec($ch);
  19.     curl_close($ch);
  20.     return $page;
  21. }
  22. function Photos_direct($epurl){
  23.     $get = curl($epurl);
  24.     $data = explode('url\u003d', $get);
  25.     $url = explode('%3Dm', $data[1]);
  26.     $decode = urldecode($url[0]);
  27.     $count = count($data);
  28.     if ($count > 4) {
  29.         $v1080p = $decode . '=m37';
  30.         $v720p = $decode . '=m22';
  31.         $v360p = $decode . '=m18';
  32.         $html .= '[{ file: "'.$v360p.'", label: "360p", type: "mp4" },';
  33.         $html .= '{ file: "'.$v720p.'", label: "720p", type: "mp4", default: "true" },';
  34.         $html .= '{ file: "'.$v1080p.'", label: "1080p", type: "mp4" }]';
  35.     }
  36.  
  37.     elseif ($count > 3) {
  38.         $v720p = $decode . '=m22';
  39.         $v360p = $decode . '=m18';
  40.         $html .= '[{ file: "'.$v360p.'", label: "360p", type: "mp4" },';
  41.         $html .= '{ file: "'.$v720p.'", label: "720p", type: "mp4", default: "true" }]';
  42.     }
  43.  
  44.     elseif ($count > 2) {
  45.         $v360p = $decode . '=m18';
  46.         $html .= '[{ file: "'.$v360p.'", label: "360p", type: "mp4" }]';
  47.     }
  48.     return $html;
  49. }
  50. $url = $_GET["url"];
  51. echo Photos_direct($url);
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement